If it was just the old head was damaged then you only needed a replacement head from a breaker.
You might have needed to grind the crank case interface flat and/or salve any erosion. But if the bottom end was good I'd a wanted to retain it - as engines from breakers can be past their best before date. If their auto was rolled, at speed it wont have done the engine any good
A head from a breaker might have needed a grind to flatten it, and the valves ground and tappets adjusted, but that is a simple job.
It would have taken me a couple of hours to replace a head a weekend to replace an engine. I'm rather slow and methodical.
The replacement engine needs to have the same part number prefix unless you are into radical tuning like fitting a larger engine for torque, larger throttle body etc...
Noel