How's the body/interior? I've found boomin's advice to be excellent over the years, btw . . . .
I like the idea of a used 4.0 SHOC. I'd find one with a good block/heads under 160k miles; throw it on an engine stand in the garage, replace all the timing chains/cassettes; re-time; leave the lower end alone (assuming the used engine did not fail and spew timing guide bits everywhere); and swap it into the truck. That way you can continue to drive the beast while you recondition the new(used) motor.
The nice thing is you can use a 4.0SOHC going back to what--1997 or so (maybe older)? All of the updates over the years were to parts that bolt to the block. So just transfer over the new bits once you get the new timing chains/gears/guides/tensioners on, and timed.
I'm a little ambivalent about the heads. If you get a decent used motor, you don't need to do them. It would be best to buy a "donor" car for few hundred bucks, wiith the engine installed and running. That way, you could run a compression check on the donor engine to verify good compression before pulling it. (This is what I did, and left the heads alone.). On the other hand, if you have a good machine shop nearby, you could pull the heads and have them reconditioned for not too much $$ (under $400-500 for the pair). If it were me, I might leave the heads alone on the donor engine, install it, and see how it does. You could pull the heads from the old (existing) engine and stick them on a shelf after you pull that engine. That way, if the new heads show problems, you could recondition the old heads and throw them on if/when necessary.
If you find a donor vehicle for cheap (crashed or rusted out body), throw the old block in the engine bay and call Mother Waddles to tow it away! She can use the few hundred bucks the junk yard will giver her for scrap metal. Good luck.