In grad school I got to attend a talk by one of the researchers who was involved in the discovery of melatonin as a sleep aid for humans. He said that his team had hoped for it to become a prescription medicine dosed at 500 mcg, because anything higher gave paradoxical effects and actually made sleep worse. But it ended up being classified as a supplement in the US rather than a drug, so they had no way to control the dosage on the market.
The other useful thing I learned is that melatonin isn't primarily involved in falling asleep, its main function as a hormone is in staying asleep. I've started taking it sporadically if I wake up in the middle of the night, to make sure I get back to a deep sleep and stay there, and it seems to be super effective for this.