When the TPS goes out, it normally produces a high idle. If you have an automatic transmission, then you may also notice some weirdness to the shifting, since the TPS sends a signal to the Transmission Control Unit as well as the engine computer. If you search "TPS" you will find lots of info- the basic test is to connect a voltmeter across two of the terminals on the square connector and look for a smooth progression of voltage change as you rotate the throttle (key in run position, engine off). Wires are lettered A-D on the connector- from my notes:"In adjusting my TPS I got only 4.6V as you did at the AD pins. I adjusted to 82% at the AB pins and it runs great and shifts fine. I don't think that 4.6V at AD requires any ground modifications." The three wires are ground, power in (between 4.5 and 5.0 volts) and signal out (voltage varies with throttle position).
A vacuum leak is more likely to be semi-constant; the intermittent nature of your high idle suggests sensors....but a vacuum leak is the other likely candidiate, check it too. If you do a search for vacuum you should find hints on where the likely leaks are (line under the battery, cracked vacuum reservoir blimp in the front bumper, etc.). 4xBob