this question was asked on another board and these are the answers they got.
"Check the O2 sensor. I had a similar problem and the O2 sensor was the culprit. When the O2 sensor dies, the computer thinks it is running very rich and so tries to blow out the excess by revving (at least that is the way my mechanic friend described it)."
"My 98 TJ did the same thing if you still have the stock gasket, align the 2 , My borla header came with a gasket that was a 1/4" difference in the intake holes, I had mine apart 3 or 4 times before I realized it, it was so fun.. as you know."