Well, money-wise, mildly (re) building a 2.9 and doing a 4.0 -stock- engine swap is about the same, if you're going to do it right. The only detracting and limiting factor on the 2.9 buildup is getting a set of the "new" WP bare heads or complete heads ($600+ for a pair). The other thing is finding ... let's see... what years of the Ranger / Explorer for "the perfect donor" ... 90-92? I'd have to find that info. Otherwise... Yeah... good luck on that!
Also, even with a little (comparatively speaking) investment, you can boost the output of a 2.9 without dismantling the engine whatsoever... to at least if not over stock 4.0 numbers.