how many miles on the truck>?
i don't know if i'd be looking for a junkyard motor over a blown head gasket. you have no idea what you're getting when they give you a used motor out of a smashed up truck that they pulled out with a torch. you don't know how well the previous owner maintained that motor, or even if it has the same issue you're already having. not to mention, i doubt you'll be doing the work yourself right? the labor is going to be about twice as much as the labor for a head gasket job, not to mention the part cost.
i just don't see why you would do it. if you're going to replace the motor (?) at least spend the money and get a rebuilt, not junkyard. i would just put a head gasket on it though if i were you and save yourself the money and the hassle.