It could possibly be the switch motor on the transfer case, these are known to hang up. Crawl under the truck and give it a couple good wacks with a rubber mallet, and see if that frees it up. If that is not the problem, get a vaccum guage and check the vaccum coming off the solenoid when switching to 4wd and back. See if its actually working correctly off the 4wd switch.