Try blocking all distractions. Auto-hide the dock in OSX, get rids of tabs, block reddit, HN, facebook in /etc/hosts, sign out of instant messengers. If you notice any other distractions, write them down as they occur. Drugs do help, so ask yourself if the insomnia is worth it.