|MadSci Network: Neuroscience|
The tongue has one of the largest representations both in motor cortex and sensory cortex of any appendage. It's role in basic taste/odor as well as communication and sensation makes it a major attentional "draw" for the brain (try and ignore a bad taste or not play with a loose tooth with it). When you are carrying out a difficult task, (particularly one which is both motor and sensory based such as playing a musical instrument), sticking out your tongue while it is compressed between your lips is providing a static "white noise" signal across a big chunk of your brain. With your tongue stuck in place outside the mouth, you rapidly habituate to that signal and are not likely to be distracted by sensory input from your mouth, or tempted to do things like talk to yourself. Alternatively, some people when they are deep in thought, but not necessarily concentrating on a specific task, often leave their mouths open and their tongues slightly protruding, but NOT compressed. One potential explanation for this is that if you are not paying much attention to your surroundings, "tasting" the air is a very old way to stay attuned to what's going on without actually paying attention. So you see, the same organ (tongue) can actually help maintain your attention internally or externally based on your behavioral manipulation of it.
Try the links in the MadSci Library for more information on Neuroscience.