If you are set on swapping the 'good' 2WD drivetrain into the 4WD chassis and swapping it over to 2ED in the process, as mentioned, you would want to use the entire suspension assembly as well. This would remove all the 4WD components from the black truck and give you the drivetrain you would trust more.
I am not trying to be cruel, but if splitting the transmission from the engine scares you, this is going to be way over your head. It is basically an unbolt and rebolt affair. As for the wiring issues mentioned, as long as you reuse the sensors for the motor in the black truck, the donor engine from the white truck should go right in without a hitch.
If you find a Chilton's it should show you an exploded view of the 2WD and 4WD front suspension, memorize it and utilize it like a set of instruction for a model car. It is the easiest way I can imagine to give advice on how to do it.
If you are going to reuse the rear end from the 2WD truck as well, it will most likely eliminate the need for a new driveshaft. If the tranny and engine mounts are in different locations, you might not be able to use the 2WD driveshaft. The 4WD driveshaft is going to be too short, as it was made to run from a transfer case to a rear end.
My advice would be to fix the head gasket on the 4WD, and if you are that set on keeping the engine and transmission, find a 2WD to swap it into.