Seems to vary quite a bit from $500 to $1500. Upper end would be for a complete recently rebuilt engine. Depends on the local availability and demand. Mechanical head would probably be worth more to diesel tuners and less to regular people.
Personally, I wouldn't pay more than $1000 for a complete good condition engine or more than $500 for a complete engine that needs a rebuild.
I paid $100.00 for my turbo engine.
Needed to be rebuilt and I had to replace the head (got one from Burn)
Raw engine in a box just before rebuild was $400.00.
No gaskets etc and a couple pieces missing.