Roger, 5th gear is not connecting. To confirm, you disconnected the linkage and manually selected 5th gear as 'deep' as the shifter would go. If yes, then the 5th gear synchro is wiped, the 5th gear fork is bent, or the shifter shaft is deranged. However, the syncho is what sees the most wear and tear, so it is the most likely component to fail.
You are dealing with an unknown, so driving it home in 4th gear is a low to moderate risk. However, ask yourself what is going to cost more a tow job (I don't know the distance you have to travel) or the potential junk yard replacement transmission if you do irreparable damage to the transmission. If I was in this situation I would drive it at speed in the lower four gears and listen for howling, clicking,...any abnormal mechanical noise(s). If it sounded and acted normally I would drive it the distance.
As for the permanent repair, the tranny has to come out and the case split to identify the root cause of the failure. Hard to say how much, but a tranny removal and reinstall is a definite, you should consider renewing the clutch, rear main seal, input seal, and CV shaft seals...while you have the tranny out. That already has you in a few hundred dollars. If you fix it, fix it to last.