I agree with the previous poster, check the iac (idle air control) motor. they also might call it an idle speed motor. when your throttle plate is closed, i.e. foot off gas, this motor is what allows air into the engine. the computer controls the idle by opening the plunger to various depths to allow air in. It is the idle control system on your Jeep. One key factor pointing to this being a problem is the jeep running okay at speed. it will run okay while your foot is on the gas, and run bad at stops. You can't really test it, but they aren't the most expensive thing to replace. we replace these motors at the shop i work at, all the time. Not just on Jeeps, but all cars, even the newer 2000's and up. They get dirty and "slow".