If not engaged properly, they will flash. 4x4HI is more 'on the fly' than 4x4LO. 4x4HI can be engaged while traveling below 45MPH with the rear wheels not slipping. Ideally though, it's a good idea to switch to and from 4x4HI only when going 15 or less, preferably stopped all together.
However, shifting to 4x4 low is an entirely different story. The vehicle MUST be brought to a complete stop and the gear shift lever placed in neutral for automatic transmissions. If using a manual transmission, the clutch is depressed.
With the brake on, the switch is moved from any of the other two options to 4x4LO. You should hear a clunk or ***** working around as the transfer case does its magic, and the 4x4LO light should illuminate solid. To switch from 4X4 LO to either 4x4 HI or to 2WD, the same process is used.
Either, failure to properly shift into either HI or LO will result in flashing of both lights. Or, if there is a problem with the 4x4 system then they will also flash.
About the codes, you will need a specialized FORD scan tool to see those codes. That cheap little scanner at autozone or wherever won't tell you anything except check engine light codes.
Attempt to shift into 4x4 HI and LO following the steps above and see if you manage to successfully engage. If you don't, you either still aren't doing it right OR there's a problem.
Thankfully, getting the software needed to look at the 4x4 system is very easy and very cheap. FORSCAN is a free option for windows laptop users and is available at FORSCAN.org. However, you do need to spend a little money. In order to connect your laptop to the truck, you need a USB to OBDII adapter. An ELM327 can be had off ebay for around twelve dollars from china, and in most cases comes with some basic software to use. The software that may come with it can simply be put aside as it doesn't come into play with FORSCAN.
Also, one last note; it's not advised to use 4X4LO on the highway. The engine rotates much too fast at higher speeds and can cause damage to parts. 4x4HI I believe is a different story, however.