If you are having this much trouble just doing a simple head gasket swap...
A V8 swap is not in the cards for you yet. There is a metric crap ton of work and research that needs to be done to make the 5.9 swap even possible. I have been bending wrenchs for 20+ years and the Magnum swap is testing my mechanical abilities.
The swap is not cheap nor easy. There are things that need to be done to make it possible that you have not even begun to think of. Some of the things that need to be addressed right off the top of my head at this point are,
motor mounts
transfer clearance (floor pan)
air intake size
brake light switch
head light switch
fuel supply
cooling
HVAC
wiring (all depends on engine/transmission chioce)
custom drive shafts
custom trans cross member
There are still a lot of other little things that need to be switched as well. I have them all written down at home stuck under the wiper blade of the truck. That reminds me, the wiper motor wiring is diffent from 86 MJ and the 93 XJ donor. I need a new wiper motor.
I am not trying to discourage you by any means. I would hate to see you get nuts deep into a swap just to scrap it because all the little things start to rear their ugly heads. Do your reasearch on the swap, a LOT of it. Before you even think about pulling the trigger on it.