"If it wasn't for my sleeplessness I never would have written a word." Louis-Ferdinand Celine
I have always been an insomniac. I used to stay up reading or writing as a kid to pass the time. I still do. A lot of writers deal with insomnia for both psychological and physical reasons.
1. Writing novels/scripts/plays, anything that requires a lot of time spent on the same subject for weeks+ on end will cause your mind to work on a consistent basis in overdrive. Psychologically, turning this off so you can get some rest is difficult.
2. Physically writing is not very taxing on your body. Sitting in a chair, typing doesn't burn much energy so you will not wear down as fast or as hard, your body simply won't BE tired. However the longterm of this is pure meltdown. Sooner or later you've got to turn it off or it will own you.
As for the sleeping pills...I recommend chewing valerian, taking nyquil, running laps before bed, eating a bunch of sugary food about 20 min before you sleep(my fav, the sugar crash drops me every time) anything before sleeping pills. Not only are they dangerous, not only do they not work for longer than a week or two, but your work may suffer.
When my doctor put me on sleeping pills it was like walking through a haze when I was awake. Finally I had to just tell him no more pills. I'm just not someone who is built for a 24 hour day, 16 awake, 8 asleep. You might find that you're not built to function at maximum performance that way either.
Good luck on the WIP, hopefully it's a bestseller and then you'll be able to stay up, for as long as you want, whenever you want, for the rest of your life.
-Grom
Stephen King, Charles Bukowski, Jack London are/were all insomniacs to name a few. There are many others but they're escaping me now.