You can get a tune to delete tranny codes from Henson Performance, a vendor that is mentioned often on this forum. You need the clutch pedal, clutch master and clutch lines from a V6 4.0 5 speed 2nd gen Explorer. There is a bit of custom wiring to sort out, and you need to modify the tranny cross member. You need a starter from a 5 speed F150, a flywheel, clutch, slave, and a block plate for a 5.0 with a manual transmission.
http://www.explorerforum.com/forums/showthread.php?t=248285
Here is a great swap thread for you. This is for an AWD explorer, and they did the extra step of converting it to selectable 4wd, so you can ignore things like different driveshafts. But otherwise, it is really in depth. On your 97, I think the VSS is on your output shaft, so I'm not really sure what you need to do there... Later vehicles put the VSS on the axle, and I'm not sure what year the F-150 switched... I think you can probably grab an output shaft housing, VSS and ring from an earlier M5R2 equipped F150... but once again, I am not sure... Hopefully someone with the answer to this question can chime in. Otherwise, ask on an f-150 board what they think the best solution would be.