2000 Ranger with 4.0l will have the 4.0l OHV engine, 2001 would have the 4.0l SOHC these 2 engines are not related.
4.0l OHV was used in many ford vehicles and in Rangers from 1990 to 2000, very reliable engine.
Only real issue was if you overheated the engine one or both of the heads would crack between the valve seats, no do overs, if you didn't pull over after seeing temp gauge going up you would crack a head.
I see this more as a driver defect than an engine defect, lol.
So it you just have blown head gaskets then it is worth just replacing those parts.
If you need/want a whole engine then used 4.0l OHV is not a bad gamble, although they are 15 to 25 years old now.
Using the newer 4.0l SOHC would require rewiring with 4.0l SOHC engine wiring harness and 4.0l SOHC computer, it will bolt up to existing transmission