You shouldn't have to do anything with the computer. I THINK pretty much any 4.0 SOHC would work, but I'm not positive. Things like intake manifolds might be different on certain years, but you can swap those parts from your existing engine.
The 4.0 SOHC came in 1997-2011 Explorers, 2001-2011 Rangers, 2001-2009 Mazda B4000s, and all Explorer Sport-Tracs.
The early ones had problems with the timing chain tensioners breaking. Replacing them requires special tools and can be pretty involved. And, if the engine is installed in the vehicle, you have to remove the engine to replace the rear tensioner.
I would look for a 2004+ engine (those have the upgraded tensioners) or, if you get an earlier engine, install new, upgraded tensioners before installing the engine.