ahh this sounds soo familiar :-/
unfortunately the best thing to do is replace it and when you do so make sure, if using a helper, they hook up the air shift lines correctly or else you'll have even more head aches like I had to go through...
like someone said above when the lever isn't adjusted correctly is rides on the little detent eventually just wearing it out... and this is what holds it in. We ratcheted the crap out of ours to the back of the cab and it last maybe...another 50 miles until high range went completely out, so then tried adjusting it even more and ratcheting that to the cab again and ... nothing. So luckily low still worked for us and we legged it back home. Like I said though, save yourself some trouble/time and just get a new xfer case and then rebuild your old one and keep as a spare. Only time till the new one does the same or who knows what else can go wrong. I did a write up about my problems, should be able to find in in 5ton area. If you have any other questions dont hesitate to ask me. I know what you are going through and what you are about to be going through :-/
ps dont forget about the air lines lol... can't preach enough. Caused me head ache after head ache, not to mention lost money with truck sitting for months