There is no real answer to this question, as it depends on too many variables. A used 4BT or an isuzu diesel engine can be found for 2k, a rebuilt 1HD-T will run you 8k. An old tranny is cheap, a rebuilt/new H151 or H150 will cost you 2k plus and up to 4.5k for the H151. A good rebuilt transfer case is not cheap either.
A rebuilt injection pump will run you at 1.5k, rebuilt injectors another $700 (for the 1HD-T).
Then you need 500 other small parts, from fuel filter to relays, radiator hoses, water pump...and many hours of labor, some of which is not trivial, such as relocating the tranny crossmember.
Your best bet is to get a half-cut, so you have a complete donor truck and most of the small parts. However, a half cut, usually with high miles, will run you a good 10k (again, talking toyota diesel engine). Personally I would not go through the hassles of a swap with a tired engine and transmission, but opinions vary.
In light of that 20k plus really don't seem outrageous and from my experience it is very easy to spend this on a good swap.
Profitts does great work, especially if you want an american diesel in there.
Chris Lynch does outstanding work, check his latest thread in the diesel section. He also rebuilt the 1HD-T I have in my truck (thread here:
https://forum.ih8mud.com/80-series-tech/519755-california-toyota-diesel-80-built-1hd-t.html)
West Coast Cruisers has great resources (check the 'shop project' link)
TorFab does conversions, Wayne/Crushers does amazing work and John at Radd has a very good reputation.
I think you have to talk to each one individually to get a reliable quote, but if you think you can get a good swap done with 10 to 15k, you need to do all the work yourself.
HTH,
cheers,
Jan