Advice on buying junkyard engines?

Most of the real work with an engine change is the bolting it back in part.

I'm also in the market for a JY magnum 5.9 right now.

Regardless of what I get I'll pull the pan, inspect the main and rod bearings, and scope out all the cylinders. I'll also run it on the stand before putting it in the car, and run a compression check as well. That all will take a weekend but it'll be better than wasting time with a mystery motor, and I can check and repair any problems.