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.
2012 F-150 XLT 4x4 EcoBeast SuperCrew
2007 F-150 XLT 4x4 5.4 SuperCrew - Leveling Kit - Magnaflow Cat Back - Tonneau cover - Traded
2004 F-150 4x4 S-Cab, 4.6, Auto, Edge Programmer - Traded
Everything You Wanted To Know About IWE's