What "sleep aid pills" did you try? Over the counter ones or prescription? Over the counter ones might be OK for the occasional bout of insomnia, but they actually do interfere with your deep sleep cycles, so that's why you might not feel refreshed when you use them. Some OTC sleep aids are nothing more than Benadryl with a different name. Benadryl can cause some people to feel restless. If you haven't tried prescriptions, consider seeing your doctor about it. They do a much better job than OTC meds. You might only need them temporarily until you readjust your sleep cycle.
Word of caution: someone posted that Melatonin does not make you feel groggy in the a.m. Actually, it certainly can for some people. Just beware that the first few times you use it, you might feel a little woozy when you wake up. Make sure to follow the label directions. It's actually pretty potent, so you don't want to take more than recommended.
ExWitless - Nurse and sufferer of sleep disorder (not insomnia, however)