The 04 will offer up some real challenges electrically -- much of the dash won't know what to make of an earlier PCM and the earlier PCM won't be happy with the Evap system.
Best option will likely be to do some wading through the wiring diagrams for both modles and then swap in the Expo/doner's instrument cluster making what wiring changes are needed.
Being an Edge, the Ranger will have the same torsion bar front suspension as an Expo making the engine/trans/radiator drop ins. The Expo A/C will primary A/C hose will bolt in, but you'll keep the Ranger's smaller condensor to orifice tube hose unless you swap in an Expo evap coil (gives a bit more clearance for the 5.0 exhaust)
A 5.0 Ranger is a truck Ford darn well should have built. Yea, the OHC 4.0 has the same basic power as the 5.0, but with a lot of maintenance baggage the SBF lacks.
I'll second using a pre-PATS PCM, it eases the wiring and will come with a transmission driven VSS that solves a ton of speed signal issues the later Expo into Ranger swaps experiance.