It is almost impossible to determine if the head gasket has been replaced, unless it's part of the documented maintenance/repair history. Carefully check on the right rear side of the engine for oil leak. The front engine cover is also likely to leak. If you see any sign of oil, chances are a head gasket replacement or front cover seal are in the plan. Check for presence of oil in the engine coolant expension tank.Other things to check: A/c and heating system. Make sure it works perfectly on all positions of the dash control. Can be expensive (very) to fix. Other things to check:
Cruise control:, flex disks, suspension links and bushings, radiator, rear engine oil seal, all electric windows, sun-roof operation, shock absorbers, brake system, exhaust system.
A full Pre-delivery inspection is your best insurance but it does not mean something will not break on your way home.