What dosage are you giving?
We give DD7 1/5th of a strip of the Enlyten melatonin, which is 0.3mg. It's atrociously expensive, and DD doesn't like the mint in the flavoring, but it's easier than pills, and 0.3mg is a hard dosage to find in pills. (Standard adult dose is 3mg.)
DrWikipedia says that more is not better with respect to melatonin, and I think that's where I guesstimated that a 0.3mg dose was a reasonable starting place. I do give her a larger scrap if I want her to fall asleep faster, so I suspect she's getting less than an optimal dose most nights. We've tried taking her off (on the theory that she might have established an early sleeping habit), and we've tried not giving it on weekends or when she's up later than normal, but she's been really resistant to giving it up - she likes that it helps her fall asleep easily.
Honestly, it hasn't changed her "during sleep" habits at all - she still gets up in the night occasionally to use the toilet or to come in after a bad dream. But she falls asleep far faster (~30 min vs. ~90 or more), and wakes cheerfully early enough to get ready for school (rather than being grumpily shaken awake by me).