The 'key trick' to get the codes is on-off-on-off-on
(within 5 secs) but won't work on '98, '99 and 2000 models.
You can check the Throttle Position Sensor (TPS) by simply unplugging it.
If the TPS is bad, revs will drop to normal once it's unplugged.
Here's a a pic of the throttle body on my '97 showing the sensors - TPS, IAC (Idle Air Control) and MAP Sensor (Manifold Absolute Pressure).
If you remove your air-intake tube, have a look at your throttle body - if it's not as shiny as this on the inside, it could also benefit from a clean.
When my TPS went bad, I drove around for 2 months with it disconnected before I replaced it.
Only side effects were Jeep used more gas and it would struggle if I gave it too much throttle (but that may be due to the 3 speed auto).
But high revving can also indicate a vacuum leak
EDIT: If the TPS needs replacing, I'd highly recommend using a genuine Mopar part only.
I've been through 3 TPS's in the last 12 months - the 2 cheaper aftermarket TPS worked initially and bought the revs back down but didn't last long.