Well I've been playing the guitar for a few years now and have a couple of guitars, but this is the first time I'm buying a used one.

Basically what I want to know is are there any tests I should do on it to make sure it's okay, is there anything I should look out for, or are there any problems that aren't really visible at first glance?

Thank you!
I've shopped for s few used gtwre but only bought one. Here's my non-exhaustive list:

You want to look to see if the neck is straight.

You want to look at damage- a small crack or chip could be nothing, or it could be the harbinger of trouble of it is near a joint or running with the grain of the wood.

Make sure the strap buttons are secure. Ditto the jack.

Give the pickups a test. All of them.

Fiddle with the knobs to see if they're secure, but also to see if there is a problem with the pots. If you hear crackles or unexpected volume drops, or other funny sounds as you play with the volume & tone controls, it needs to be taken care of.

Check the tuners. If they're having a problem, you'll notice that turning them won't affect the tuning the way you'd expect.
Sturgeon's 2nd Law, a.k.a. Sturgeon's Revelation: “Ninety percent of everything is crap.”

Why, yes, I am a lawyer- thanks for asking!

Log off and play yer guitar!

Strap on, tune up, rock out!
Take a look at frets and see if they're in good condition. If the guitar has floating bridge check out does it detunes guitar when you use tremolo. That's all I can think of that's not already mentioned.