well, as for as work? Hell you could put an general electric gas turbine engine in your truck if you really wanted too, any engine will work lol
As far as amount of time and money? then yes the 4.0 v6 is the best way to go and easiest as far as the swap goes. Just get ready for some wiring work, and your going to need to swap the transmission aswell. Im 99% postive the bell housings are different from the 3.0 and 4.0.
the 4.0 would be cheapest, and the least amount of work for the giving power increase. But depending on what you use your truck for you may want to drop the extra time and money into a 2.3 motor, rebuild that and put a turbo on it. That will easily make more HP then a 4.0 and depending how crazy you go more torque aswell. Just go on youtube and look at some vids of turbo rangers, im sure those will help you decide. I know if i had my bronco II again, i would definatly have swapped a 2.3 turbo in it, given the amazing results ive seen on youtube haha!