Here is the in-depth write-up that I hope can serve as a how-to for OM617-swapping 96-04 Tacomas/4Runners (and T100's).
I picked up this $600 1997 4Runner 5VZ/A340 4x4 (rear e-locker) with roughly 250k miles and it was SHOT! Completely rusted out even though the body doesn't show it. Destroyed interior. Radiator blew up and mixed trans fluid with coolant to make a milkshake in the trans. Now I haven't read a single report of anyone flushing their trans and successfully driving it after that. Even the ones done under warranty at the dealership with the power flush had trans failure shortly after. Keep an eye on your radiator if you've got an automatic! The PO claims he noticed it right away and had it towed home where I picked it up. I flush the trans, added a new radiator, and put another 30k on the 5VZ! I daily drove it to work, used it to tow the mower trailer around, and even drove it 3 hours into Iowa with the trailer to get a band saw. Did a fair amount of wheeling with it, too, enjoying the rear locker. Eventually, it started losing coolant, so the 5VZ got yanked and sold.
The plan for this has always been for R&D. The only money I have into this rig is the new radiator and mounting the free tires someone was throwing away. Sold the 5VZ to cover the purchase. Can't beat that! I'm currently swapping in an OM617. I'll be using the 4Reigner to test trails I'm cutting in our pasture, as well as haul the tree cutting equipment around. Since the frame is already falling apart, I don't expect to keep this around much longer. I had originally planned to do a TDI swap after the 617, but have since decided not to worry about making TDI adapters for the Toyota Automatics, as the torque converter pilot stub would require turning down, and that is probably too much effort for most people. Once the frame folds in half, I'll pull the 617 back out to go into something long-term, and I'll save the rear axle and trans.

I like your attention to detail. I have over the years owned 5 Toyotas and Three MB diesels. I also currently have a MB 560SEL with the European Engine.. My daily driver is a 1998 Tacoma Extracab SR5 with the 2.4 engine RWD. I have been planning a contingency of putting in a 1985 300SD OM617 motor for sometime. My Tacoma has the A43D transmission which is a 4 speed Automatic non-lockup converter. 1st 2 3 4 Rev
2.452 1.452 1.000 0.688 2.212
Its the same transmission used in the Toyota Motor homes.
The 300SD was designed such that peak engine torque was around 60 MPH
mating the OM617 to the A43D with the stock rear axle on my truck would put peak engine torque at 75 MPH.