Hi Pete, I just put my multimeter (or use a test light) on the connector pins going to the vacuum solenoids that supply the diaphagm on the transfer case. The 4wd one got 12V with the H4 button in & 0V in 2wd so all good, but the 2wd one would not always get a 12V signal when the H4 button was switched off. The vac solenoids are high on the firewall, follow the hoses up from the t-case. Applying 12V direct to the solenoid shifted it every time, so it wasn't a fault with that - which can happen. I also checked the H4 switch was doing what it should electrically but that was OK.
I also had electric hubs that were replaced with manual, so before I rewired I always had to hit the hub lock button before it would engage H4.
Another useful troubleshooting method is to apply vacuum directly to either side of the t-case diaphragm by swapping hoses to bypass the solenoids, do this to check that the transfer case end of things is working correctly first. With the engine running, transmission in N, handbrake on & hubs out, you can just reach under the truck & try spinning the front driveshaft to check 4wd shifting. It should spin by hand in 2wd, & lock up in H4 as it is then connected to the rear drivetrain.
Cheers
Clint