I take benadryl (diphenhydramine is the generic) usually with the pain pills. I get agitated and itchy. I have tried valerian, but quite frankly can't recall if it worked or not.
The reason I said melatonin is that article I linked to said that blue light from the computer screens mimics daylight, and stops the body from producing melatonin. So if you take some while on the computer, it will replace what you would normally be making yourself and put you in sleep mode. It is also used to acclimate yourself when changing time zones and for jet lag. I used to use it to help regulate my sleep pattern when I changed shifts, especially trying to sleep during the day. The stuff I had was a liquid, and you just needed a little dropper full.