Yes the early 4.0l SOHC had that problem, 2001 was the first year for Rangers and the 4.0l SOHC.
In either case, a swap or a rebuild, you have to pull out and then reinstall the engine, so that labor/cost is set.
New timing chain kits have better parts so replacing timing chains and guides would be more cost effective.
Used engine is a mystery, could be good, or you could be buying someone elses problem.
You for sure don't want a used 4.0l SOHC older than 2003, or you are just buying the same problem you have now.
A 4.0l SOHC is rated at 207 horse power
A 5.0l V8 is rated at 215HP
So that swap not really worth the effort IMO
TSB 02-7-6 4.0L SOHC Timing Chain Rattle
*Engine - 4.0L SOHC - Rattle noise from primary chain drive area between 2K-3K RPM - Cold engine operation only
*Noise - Rattle noise from primary timing chain drive area between 2K-3K RPM - Cold engine operation only - vehicles equipped with 4.0L SOHC Engine only
Ford: 99-02 Explorer, 01-02 Sport Trac, Explorer Sport, Ranger
Mercury: 99-02 Mountaineer
Some vehicles equipped with the 4.0 SOHC (Single Over-Head Cam) engine may exhibit a Primary Timing Chain rattle noise. The noise is audible during hot and cold engine operation (but predominantly found on cold engines) under acceleration, typically at 2400-2500 rpm. To confirm presence of this noise, accelerate in 2nd gear between 2000-3000 rpm and listen for rattle noise that sounds similar to spark knock. This may be caused by the Primary Timing Chain Tensioner system.
Replace the Primary Timing Chain Tensioner, Chain Guide, Jackshaft, and Crankshaft Sprockets with a Primary Timing Chain Tensioner Kit. The kit includes an improved Primary Chain Tensioner, as well as updated Primary Chain Guide, Jackshaft, and Crankshaft Sprockets. Required fastners, primary timing chain, and front cover gaskets are also included. Refer to the following Service Procedure for details.
Verify the condition. Obtain the correct kit and follow the sheet supplied with the kit.
Use kit 2U3Z-6D256-AA (balance shaft engines) for:
-99-01 4x4 Explorer/Mountaineer
-01-02 4x4 Sport/Sport Trac
-All 02 Explorer/Mountaineer, except engine codes 2G-960-AA and 2G-964-AA
Use kit 2U3Z-6D256-BA (non blance shaft engines) for:
-99-01 4x2 Explorer/Mountaineer
-01-02 4x2 Sport/Sport Trac
-02 Explorer/Mountaineer with engine codes 2G-960-AA and 2G-964-AA
-All 2001-02 Ranger
Labor Time: Estimated around 6 hours
Warranty Status: Elgible under the provisions of Bumper to Bumper warranty coverage