The best I could figure out is that the TPS was bad in such a way that when the throttle was at idle the TPS told the computer otherwise. Could have been caused by a faulty connection inside the TPS, specifically the ground connection--if that's lost the TPS will read 5 volts all the time.
This would cause the computer to open the idle air controller, making the engine rev higher. (The computer opens the idle air controller when you have your foot in the gas--it does this for a dashpot-type function of gradually closing the IAC when you take your foot off the gas)
Brian