Welcome to Jeepz.com :welcome: '98 grand , was supposed to inherit one from my dad . Said no and should taken it as its long gone now. My younger brother turned it over on the street at 40+ and my other brother stripped it what was still good . I was supposed to get the rear disc set up for my '92 XJ but they flat bedded it too soon. Well any way , it was a real nice jeep , power everything ! No wonder you love it ! These rough idle , hesitation , hard start / no start and stalling are starting to grow in numbers around here. Sounds like the former owner either did not maintain well enough or did all the basic maintenance and couldn't find the problem. I have some questions for you ; to your knowledge , was it tuned up and fuel filter changed ? At the minimum , change fuel filter if it wasn't and note any change in behavior . The jeep , not yours . Lol.
don't know your level of skills maintenance and repair wise but if you want to take this on your self , we can advise you . Fuel pump pressure should be checked , fuel pressure regulator vacuum line on and off . Record readings . Cylinder balance test to find if one or more cylinder is a problem. This is easy , you just need the adapters that plug onto the spark plugs and plug high tension wire (spark plug wire ) back on . With engine running , use a 12v test light clamped to ground and touch each adapter for a second . The rpm should drop while grounded . If there is no change in rpm , that cylinder is a problem. That's my way since I have the adapters (somewhere) but you can just pull a wire off a plug and note change the same way. If you find a bad cylinder , check the spark plug for damage I.e. cracked porcelain . Check plug wire for damage like cuts or loose or broken connectors. Check distributor for cracks and carbon tracking inside cap. Check rotor for burned tip and worn tip. Take off air cleaner snorkel to throttle body and see if Venturi is dirty , especially around idle air valve inlet . Idle air control motor should be removed and cleaned along with chamber the control motor attaches to. If real dirty , the housing that the idle motor attaches to should be removed from throttle body , housing and throttle body chamber cleaned thoroughly with throttle body spray cleaner.
Look for any leaks around where fuel injectors attach to intake and to fuel rail. If found , o-rings should be changed on all injectors , top and bottom. Pull spark plugs out to see if saturated with raw fuel . Note exact condition of spark plug ; fuel saturated , carbonated, electrode damage , inner porcelain damage and/or color and condition(contaminated) . A compression check with all plugs removed and throttle valve (accelerator linkage) wide open should be performed to determine condition of engine. Record all results after each procedure. This is a good start diagnostic wise , but if unable to perform yourself , at least you will know what a mechanic should be doing for you and at least know what to expect from their service. Hope this helps. Let us know how things go when you can . Best of luck , greg