I own both a TJ and an XJ (just bought one). Now rust is certainly a major concern but it's not the end of the world. The XJ I just bought I learned was titled in NJ (didn't even think to look) it's spotting rust all over the undercarriage but it's just surface rust. Now the components look awful but if you like working on cars then who cares, replace as needed. Crawl under it and check the frame with a flashlight, surface rust can be dealt with but look for bubbling, cracking, and holes. Those aren't worth the trouble.
Now, more importantly, once you buy it pull up the carpet....all of it. Inspect the tub in there, your inspection underneath didn't find any holes so the inside should be clean or simply surface rust. Now if there is surface rust, (my TJ and the XJ both had lots of surface rust on the driver's seat foot area) sand it and bedline. I took this time to do a full bedline of the inside of the TJ (I will be doing the same for the XJ). At these time you could put the carpet back in but most don't as it holds moisture, salt, and water. If you want to run them run some good rubber mats and empty them out when they fill with snow.
Lastly, the XJ I just bought has 123k miles on it. For the mileage and clean stock set up it was worth it to me (despite the rust). I do all my work, and I enjoy little projects. From what I've always known, this isn't high mileage for the I6. When I brought her home the coolant was backed up and bubbling everywhere. Had to do a huge flush, it was a pain and clearly hadn't been maintained. Things to check:
-frame (front, back, middle -- check closely where the tranny skid meets the frame)
- body (check for bubbling, especially fenders, pull up carpet where you can, check from underneath. Also, look for mud, scratches, dents under the jeep in places it shouldn't be. that will tell you if they wheeled it, assess from there...)
- leaks (it's common, easy fix, but be aware of what may need some maintenance...engine/oil pan, transmission, transfercase, and axles)
- check the rear axle, dana 44 is preferable if you're wheeling, usually comes with a dana 35 which is ehh but if you're not wheeling it won't matter. check the steering components on the front, do the joints look ripped, old, or super rusty
- check interior (AC, heat (this could hint about coolant, my XJ had poor heat and as such the coolant was a mess), window cranks, lights, radio, dash codes
-check engine bay, oil dipstick, general cleanliness (engine bay will be very dirty if they went mudding)
- during your test drive, test the 4 wheel drive, 4 hi and 4 lo (test by doing a tight turn in 4 hi and the jeep should bind up -- don't hang onto the steer wheel, just feel for a slight bind and you'll know it works), does it shift smoothly, how does the engine sound, listen for clicking, squealing, and clunking (signs of ujoint failure, bad brakes, bad ball joints), how's the steering, do the headlights work, radio, all the vents blowing air, do the selectors work....lastly get it on the highway if you can (I didn't) and see how it drives, will the wheels need balanced etc.
I know I'm missing stuff but you get the idea, checking all this stuff doesn't take long it's just thorough. When I popped the cap off the coolant reservoir it looked disgusting so I knew I was going to have some work to do. That's all you're doing here, assessing what may need to be done. If you catch some items (say a bad ujoint) don't turn it down, the jeep will not be perfect. Just know you'll need to do some work on it, or put a few extra bones down to have it done. I made some mistakes on the XJ, I was a little lenient with the rust, I have some work to do haha. The TJs go for a premium, the XJ you can find for much cheaper just FYI.
Lastly DO NOT BUY ANYTHING WITH AN INLINE 4. Everyone always regrets it, it has no power. On top of that, no one wants it so you'd never sell it if you really had to. Hope this helps, I urge you to take the time to look at Jeeps, there's no free lunches in the world, if something is cheap it's because something is wrong with it. be careful!