Frame is the big deal. As the other guy said, put your fingers in the holes and see if there are any chunks of rust falling off. Also check for rust where the skid plate meets the frame and behind where the front lower control arms tie into the frame and in front of where the rear lower control arms tie into the frame. Surface rust is fine and easy to deal with.
The 2.5L is a good little motor. If you have plans to go big, say 35’s+ then you’d want to hold out for a 4.0. The 2.5’s are known around here as ‘the four angry squirrels.” If all checks out well with the frame, then check to see if the Jeep ihas any codes thrown. Key off-on-off-on-off-on and they should flash on the odometer.
If all is well, go for it. Change all your fluids so you have a baseline, change your plugs, etc...just do solid maintenance and start to get to know your TJ.
Ask questions about everything here on the forum, and I mean everything. The first two things I added to my TJ are the only two things I removed later. So checking here with all the user experience will save you tons of money in the long run, and these little Jeeps beg for money...
Post up a pic of the rig....speaking of pics, here’s mine, 2 years ago December it was stock.