Definatly test your grounds
Especially the transmission ground cable. I've heard horror stories where a loose ground caused bad running conditions. Hundredsof dolars later a scoket wrench solves the problem.
Otherwise... Could your TPS be going bad? Possibly the IACV (Idle air control valve) or even a sticky throttle plate, check for deposits around the flange (round thingy inside the throttlebody)
These are shots in the dark by the way but might help narrow it down some.