I have struggled with insomnia on and off throughout my life, and over the years (and with the assistance of my wife) have taken steps to improve my chances of getting a good night's sleep. The most effective protection against insomnia in general has been to get up at the same time every day; routine is a strong defence against all manner of mental troubles. Also important has been stopping playing videogames, working on philosophy or composing prose text within the two hours or so before going to bed. It is in the context of this that I believe insomnia might be intelligible as withdrawal.
The prefrontal cortex of the brain is the site of most executive function, and where decisions are made. The cruchiest of decisions – those with a strong mathematical, or logically calculable element – are made in the orbito-frontal cortex (which I have dubbed the decision centre, although in fact other neighbouring parts of the prefrontal cortex are used in some kinds of deciding). This part of the brain is directly linked to the pleasure centre (nucleus accumbens) – we are wired to find making good decisions rewarding. The chemical messenger in this reward process is dopamine, and this is associated with habit formation and all addictive behaviours.
My suggestion in respect of insomnia (or at least, the kind of insomnia I suffer from) is that it results from the decision centre's relationship with the pleasure centre. When we are working on a puzzle, problem or decision, the pleasure centre will provide dopamine in two general cases: when we find a solution, and when we anticipate reaching a solution. I previously discussed this in the context of videogames as Grip – that which keeps you going back for “one more go”. A really deep problem is compelling to those of us who have well- (or over-) exercised decision centres e.g. lovers of hobby games and strategy games, analytic philosophers, programmers etc. The fixation on a problem may be tied to Grip – the anticipation of future reward, which in itself delivers dopamine.
Thus insomnia as withdrawal postulates that when we go to bed with an active decision centre, we fail to get to sleep because our decision centre craves more of the dopamine, which compels it to keep chewing over the issues in question (in pursuit of its reward). In some cases – such as philosophical problems – there may be no final solution to pay off the big reward (fiero), and the anticipation of reward may be all that can be expected. This may have contributed to Wittgenstein's tortured nights, during which his mentor Bertrand Russell tried to lend support as best he could.
This would also explain why, when possessed of a particular problem, I wake up in the middle of the night and can't get back to sleep: my brain completes a sleep cycle (approximately three hours, including REM state dreaming), then the decision centre – hungry for a hit from the reward centre – demands attention. It is in withdrawal. Similarly, a friend of mind asked that we might ease down on the crunchy, calculable hobby games such as Power Grid because he found himself waking in the middle of the night thinking about problems of the kind the game presents, and this seems to tally with my account here.
If this idea holds, the most effective defence against insomnia of this kind may be to engage in more passive pleasures before sleep e.g. undemanding fiction, mindless television, a pleasing hot drink. (However, note that fiction can be an involving, rewarding process – our minds are often highly active implying fictional truths from what little is actually stated in a work of quality fiction in any medium, and even trashy novels can be addictive – perhaps especially so). Meditation, with its focus on “quieting the mind” (and in this, silencing the demands of the decision centre) would also be effective.
Of course, gamers may often escape insomnia as withdrawal by simply continuing to play the games they were playing deep into the night – this is insomnia as addiction, which I certainly had when I was playing Pokémon Red many years hence, and have also had with certain books that simply demanded continued attention. The fact that there is an equivalent case of addiction that parallels my description above suggests to me that this concept of insomnia as withdrawal has some merit.