2004-2006 Ranger 3.0l engines had a problem with Recessed Exhaust Valve seats, which causes a loss of compression.
Fords TSB can be read here: http://www.ford-trucks.com/forums/88...placement.html
Your numbers point to this.
You can do a leak down test on #5
Leak down means you remove the spark plug and put piston at TDC, valves closed, then apply known air pressure, like 100psi, thru spark plug hole, and then read how much pressure will hold.
If it shows 90psi then you have 10% leak down which isn't bad.
But real reason for YOU to do this test is because you can listen at the exhaust pipe, and if you hear/feel air escaping then 100% confirmation on exhaust valve issue.
I would first check with local machine shops, a few, and see if they can install new seats and exhaust valves and how much, then also get them to price rebuild heads, both heads need to be done.
On ebay a set of 3.0l heads are listed at $320, plus shipping, so if local machine shop can fix yours or get you a set for $350 then that would be a fair price
You also need head gasket set($65) and head bolts(can't reuse these)($32), also coolant($15)
Many also change thermostat when doing this much work($10)
3.0l engine was very reliable, Rangers had them from 1991 to 2011, so literally millions are out there and still working, in Rangers and Taurus/sables
So redoing the heads would be worth while.
Swapping the engine is a gamble, usually not a bad gamble but you will have 0 history on the "new" used engine, it could have been over heated or internal parts stressed when running engine was suddenly stopped in an accident.
Used engines don't usually come from working vehicles, lol.
If you can't or don't want to o the work yourself, then shop time to do both heads, R & R(remove and replace), should be 8 hours, actually only takes 5 or 6.
Shops often like to supply all the parts, i.e. gaskets, bolts, and heads, some won't do the work unless they do supply parts.
This is because you would expect them to warranty the work, most people do, lol.
If you supplied the heads and there was a head problem.............who pays?
Or if a gasket, you supplied, failed?
But go in KNOWING the prices of the parts they will be supplying and ask for the prices of these parts upfront, if they seem out of line ask why, they will be "marked up" but 15% is normal, 100% is NOT.
Your truck, your money, YOUR CHOICE