I, too, have experienced this annoying "feature". It only seems to happen when docked in my Bose dock. I have found that when it happens, simply restarting the thing only plays the music for a random period of time, and it inevitably shuts off again. One trick I have found is that if you reset the Nano, it happily plays without shutting off. Resetting does not erase anything; however, if you have customized some of your settings then they will change.
This is a quick fix, but not the right fix.
Hope it helps until the glitch is fixed.