Melatonin is good for help getting to sleep, but should not be taken over extended period, as it makes your body stop producing its own - from what I've read. I never heard of using a sleep med for GERD.
I use it maybe a couple of times a week, and it sets my body to get sleepy as soon as it gets dark. Now my body wants to sleep at 9PM. I've never noticed it did anything for reflux.
But I haven't read everything, so keep on searching.