No on the 4.0l, not a good swap, same cost and effort to do V8 swap so that would be what you would do.
Swap for either is engine, transmission, exhaust, computer, and engine wiring.
If you want a 4.0l Ranger you can sell the 3.0l Ranger and buy one, which is why the swap is not a good idea, cheaper just to buy one.
3.0l engine is a high RPM engine, you need to "drive it like you stole it", keep the RPMs up, that's what it was designed for.
Best torque is at 3,300rpm
Doesn't get highest horse power until 5,000rpm
Specs here:
http://www.therangerstation.com/tech_library/3_0performance.shtml
Check throttle cable, over time the cable stretches and you no longer get full throttle.
Very simple fix for this is to add a couple of zip ties to end of cable above gas pedal
Google: Ranger throttle cable mod
All fuel injected Rangers have Cold Air Intake and mid range power headers stock.
You can switch from mechanical radiator fan to electric fan, that frees up some power and gives better MPG, so a win-win, isn't much, but for sure isn't 0 either
You can change the rear axle ratio by using smaller tires, this will give you more low-end, off the line response.
If you have 27" tall tires now and a 3.73 rear axle ratio, then changing to 24" tall tires would give you effective ratio of 4.20
3.0l Vulcan engine was/is a good reliable engine, wasn't a power house, and wasn't build to be one.