I'm having the same problem with the "Service 4wd" message on my 08 Z71. It will get stuck in 4wd or will not engage at all at random times. I finally took it to the dealership yesterday because I am about to sell the truck and want it to be in good shape for whoever happens to buy it. It is under 100k so it has the so called power-train warranty. The dealer finally called me back today and said that they couldn't get the message to appear but found two codes stored on the computer, one for the 4wd switch and the other for the transfer case control module. They also told me that they didn't think that either was covered under the warranty.
Has anyone had this problem fixed under the warranty?
If its not covered, I'll probably just pay the $100 fee for them to run the diagnostics on it and sell it as is instead of dropping who knows what on the dealership to fix it assuming they know what is going on.
I also plan on checking the switch to make sure it is not the problem. The dealership I took it to is somewhat new and seems like they have no idea what they are doing...