Only way to make a 3.0l go faster is to put it in a lighter vehicle, i.e. go cart.
You can swap mechanical cooling fan for an e-fan, that frees up some power and you get better MPG, doesn't change emissions.
Any engine changes will effect emissions, computer tuners can increase available power and also have a "test mode" for passing emissions tests, no that is not like a "chip", lol, they don't really help.
Best bet would be to look for a 4.0l SOHC Ranger you like then buy it and sell the 3.0l Ranger.
Engine swaps in "smog testing" areas can run into some extra costs, if you are just swapping a 3.0l for another 3.0l then it is fairly straight forward.
When you change engine size(VIN number) then you need modified title change.
So after the swap is complete you have to pay a vehicle inspector to certify it as "road worthy" they will also test emissions.
If it doesn't pass inspection then you have to fix what was wrong and pay again to be retested.
So it isn't just passing smog test when changing engine size.