Welcome to TRS
The 1997 to 2003 4.0l SOHC engine did have timing chain issues, and the engine does need to be removed to replace the rear chain.
2004 and up got the newer design tensioners(main issue) and cassettes, so that problem was rare, but could happen.
2006 4.0l SOHC should not have had that problem, but since it is new to you....previous owner may have run low on oil or ???
If it is a timing chain issue then you don't need a new engine, but do need the engine pulled out, repaired(new tensioners and cassettes) and reinstalled.
And hopefully it was just a timing chain issue, the mechanic is suggesting a new engine because there no way he, or anyone else, can know if it is only a timing chain problem.
He doesn't want to do the repair and then have unrelated engine problem show up, and you getting pissed off at him and the shop.
And no there is no way to tell unless you go thru the whole engine, which is called a "rebuild", lol, not just timing chain repair.
So roll of the dice but still not a bad bet with the 4.0l SOHC because timing chain rattle a known issue
4.0l SOHC was used in a few Ford Models
2001–2012 Ford Ranger
2001–2010 Mazda B4000
1997–2010 Ford Explorer/Mercury Mountaineer
2005–2010 Ford Mustang
So there are lower mile Used engines available, you would want 2005 or newer for sure
And most have some sort of warranty but it does NOT cover labor to remove and install if it fails
Re-Manufactured(rebuilt) engines are sold as Long Blocks, crank, pistons, heads, cams and chains installed, usually oil pump.
You use the intake and oil pan, water pump and accessories off your old engine, and all of that adds up in labor.
I don't think a used low mile 4.0l SOHC would be a bad bet, but it is an unknown