Hey y'all. I don't really feel a need to post this question, but since this is what forums are for... why not! It might help someone else, or I might learn something.

My '98 4.0 5-speed has a very intermittent issue that goes like this:

1) I am driving along, usually in 4th or 5th. My foot is on the accelerator.
2) A soon as I take my foot off the accelerator (still in gear; not neutral) the Jeep sort of lunges forward a couple of times and jerks a little bit. This only lasts a couple seconds.
3) The Check Engine Light (CEL) comes on.
4) From that point on, it idles very high and rough (like 1100 to 2000 RPM) whether I'm stopped or coasting in neutral.
5) Once I turn the engine off, then back on, the Jeep starts to idle normally, although the CEL will remain on for probably 1/2 day or so.

I feel like I can induce this issue if I wish, simply by driving in gear and quickly removing my foot from the accelerator. It seems like the quicker I remove my foot, the more likely the problem will occur, and the rougher it will be.

The CEL gives codes: P0121 & P0123 which both have to due with the Throttle Position Sensor (TPS) voltage being out of range.

My question is: I'm going to replace the TPS this weekend, and does my reasoning make sense:

I am thinking that "somehow" the TPS gives a bad reading when I "quickly" remove my foot from the accelerator pedal. With the TPS mis-reading now, more fuel is being injected than there should be. Like the TPS says I'm still accelerating.

If the TPS doesn't fix it, what else would induce a problem like this?
It doesn't seem like there is something wrong with the Throttle Body itself, otherwise this would be a constant issue.

Thanks in advance.