he says it comes with a warranty etc but we all know the terms and conditions and small print make a lot of these not worth the paper they are written on.
This sounds a bit handwavy. I don't "know" that at all. A warranty is a contract and it's enforceable in civil law. Obviously you need to check the credibility of the seller, but it sounds like you are set on the AA inspection even with the warranty.
I also wouldn't expect too much from the AA inspection report. Does it come with a promise that if something does go wrong, the AA will pay for it to be fixed? I suspect not.
I want it to be safe for my 17 year old son.
The MOT is meant to do that. Brakes and tyres are 90+% of car safety. A blown head gasket is an expensive repair but it's not a safety issue as such.
following a near miss with buying a car that had a visible issue on the test drive.
In other words, the test drive — which is an essential part of any car purchase, and free of charge — found the problem? I don't call that a near miss.
The AA is a great brand, but their inspectors do not have a magic capability to see inside the car and tell you if the clutch will fail in 500 miles or the head gasket in 2000, unless those components are already in the late stages of wear — in which case the symptoms can be picked up in two minutes on a test drive.
So if the car is not very expensive and the friend knows his stuff, it might not be a great investment to have the AA inspection. As an absolute minimum, let the friend look at it first — if he says it's a dud then you won't buy it and you've saved the AA inspection fee (on this car, anyway).