You need to build the string outside of the tool perameters so that you can wrap parts of it in quotes for the tool. Remember this isnt just a string, its and SQL statement so you have to comply with SQL conventions.
>>>where="UID <> \'" +str(uid) + "\' AND STATE = \'" +state +"\'"
"UID <> 'oid' AND STATE = 'state'"
gp.Select_analysis(USA_State, USA_State_Select, where)
qry = "[UID] <> '"+uid+"' and [STATE] = '"+state+"'" gp.Select_analysis(USA_State, USA_State_Select, qry)