Caveat emptor...
Unless it's a running engine the deal is half now, half when the heads are verified to be OK.
Not fool proof, but if a core is bought w/a bad bottom end, the chances are better the heads are OK. If the engine has a sound bottom end but it's "not running", be suspicious.
Sometimes a cracked head will manifest itself by allowing coolant into the combustion chamber- this'll scour the plug clean (easy to see) along w/the chamber. If a bore scope is used, the chamber can be seen. Of course, this could be from a blown head gasket (possible water in oil and vice-versa), but I'd be leery of a blown head gasket as well- too much chance it was run hot.
If the engine is in a junkyard some things to look out for is straight water in the radiator. Pass it up- if it had an intake leak, etc. few people will continue to refill the coolant tank w/antifreeze at $12-$15/gallon.
I'm always surprised by how many guys will go to a 'yard looking for an engine and not bring a battery to turn the engine over with. Often a bad bottom end can be heard even using just the starter motor.