Mechanics - replacing head gasket vs the engine...?

“Umm a used head gasket is a really bad idea.”

Maybe the friend was offering a used head for $40.

Anyway, if the body and interior are in great shape a low mileage used JDM engine is the way I would go.