Rebuilt 4.0l 4WD M5OD-R1 is $750-850, New one is $1,000
Used from $??? to $600
You can use a 1990 to 2012 M5OD-R1 from a 4.0l 4WD Ranger or Mazda B4000
So there should be quite a few used ones out there you just need to find them
They are a very reliable transmission, yes your input shaft and bearing reads like it is bad, can happen just not very often with these transmissions
So used M5OD-R1 is not that much of a gamble
M5OD-R1HD will work as well, found in 2001 and up Ranger/Mazda 4.0l 4WD trucks
As BlackBII says, if you are willing to swap tail shafts then might as well tackle the rebuild, there are a few How-tos on rebuilding the M5R1 and M5R2, R2 is similar just heavier duty version for V8 engines, no it won't fit your 4.0l, but rebuilding step by step is the same as R1