Welcome to TRS
Engine conversion articles are here:
http://www.therangerstation.com/tech_library/index-conversions.shtml
Read this one first:
http://www.therangerstation.com/tech_library/4L_Conversion_faqs.shtml
1990-1994 4.0l Ranger manual trans computer(EEC-IV/OBD1) and wiring harness would be the best choice.
2.9l M5OD trans will bolt to the 4.0l engine, use 4.0l clutch parts.
2.9l would use a MAP sensor on the firewall as main air/fuel sensor, 4.0l used MAF(mass air flow) sensor on the air cleaner box.
In 1995/6 4.0l MAF sensor changed from 4 wire to 6 wire, the IAT(intake air temp) sensor was taken off the upper intake and moved to the MAF sensor, the extra 2 wires.
The 1997 won't have the IAT sensor on the upper intake, but the 1994 and earlier wires for it will be there at the upper intake, you can use a 6 wire MAF sensor and just reroute the 2 IAT sensor wires over to the MAF and connect them there.
You will need the 6 wire MAF connector as well because 1990-1994 wiring harness will have the 4 wire MAF connector.
Or you could change the upper intake, take 1997 upper intake off and replace it with 1994 or earlier upper intake, and use 4 wire MAF sensor, then wiring would match.
4.0l never used a distributor, 1990-1994 used an EDIS-6 module, 1995 and up had the newer Ford computers(EEC-V/OBD2) that had the EDIS module built in.
Older EEC-IV has 60 wires, newer EEC-V has 104 wires, EEC-IV is less complicated for 1989 since that is what you have now.
Google: EDIS-6
To see what it looks like, it is usually on the Rad support front or back side and it is plugged into engine wiring harness