dear chamila, check the engine for timing,, have you replaced your timing belt or chain at the specified correct time? then check the "throttle air bypass valve" (located in the throttle body)is correctly functioning coz its responsible to control air when the engine is idling, and check its bypass cavity is not blocked by dirt and debris finally check the MAF sensor if your jeep have one. coz bad MAF (mass air flow sensors) are known to cause this type of rpm behavior.
Also you might find this manual useful http://www.mivec.co.nz/tech/4G9x_Engine_Manual.pdf
Cheers,
Archon