It sounds like a good suggestion from jkn913. Puritan's Pride has something called "Calm Tabs." I would guess they are somewhat similar, though I don't think they contain magnesium--just herbs.
You could always check them out with your doctor in case of any med interaction, of course.
It's miserable when you can't sleep! I hope things turn around for you soon.