The 4.0L in the Jeeps is an excellent engine. It's not uncommon for them to go 200-300K miles with decent maintenance. The same goes for the AW4 auto tranny.
The following pertains to the Cherokees: IIRC, 1996 was the first year for OBDII. I don't remember when they changed from Renix to OBDI, but I'd guess around 1990. The 2000 and 2001 models will have a low pinion Dana 30, prior to that they had a high pinion D30. If you buy a 2000/2001 model, swapping the front axle for a high pinion from an earlier model is a bolt in job. Any of them with ABS will have the craptastic Dana 35 rear axle. Without ABS, it should have a Chrysler 8.25. Pre-96 models(and some/most '96 models) will have
less desirable 27 spline axle shafts. From late 96 on, they will have 29 spline axles which are slightly stronger. Locker selection for the Chryco 8.25 is sorta limited, but it's a decent axle. Swapping in a Ford 8.8" from a '95-'01 gets you disc brakes and possibly the gears you want. The swap isn't that difficult, but does require welding on new spring pads and shock mounts. You'll also have to change the e-brake cables. It's been done enough that you can buy everything you need without a problem. There are multiple threads on naxja about it, and lots of pages elsewhere on the internet on it.
The part time NP231 transfercase is well supported by the aftermarket. 4 to 1 low range kits, 2wd low kits, real short shaft slip yoke eliminators, wide heavy duty chains, doublers, etc. are all available. The NP242 offers both full and part time 4x4 operation, but there really isn't any aftermarket upgrade support for it other than "hack and tap" slip yoke eliminator kits. You DO NOT want the full time NP249 transfercase, as someone else mentioned. The viscous coupler in that case is known for failures.
I don't know much about the ZJ's, but the 4.7L v8 equipped version my wife's stepmother had got better fuel mileage than the 4.0 equipped version she has now.
If you're going to buy a cherokee, it'd be a good idea to read up on them somewhere like naxja. There were a lot of little things that changed here/there and I'm sure you want to start with the best base to build on.