REM sleep - associated with dreaming - seems a likely candidate for some sort of special "maintenance" task. Many people believe that memory consolidation occurs during REM sleep, and there's evidence to show that...yet many anti depressant drugs reduce or completely eliminate REM sleep, with no detectable effect on learning or memory.
Hmmm. Hadn't heard of that. Another piece of evidence pointing to the importance of REM sleep is the "REM rebound effect", where, when one is deprived of REM sleep, one reaches REM faster and stays there longer the next time it is available.
Another theory, which might not be "as opposed to" memory consolidation but "in addition to", is that neural exercise occurs during REM sleep. Neurons fire across the brain; when neurons in the visual cortex are activated, we experience hallucinations we commonly call dreams.
So these are the 'mental gymnastics' I keep hearing about! Creationists aren't stupid, they're just sleepy.