No, I do not think I would give melatonin long-term, unless the child had a medical reason for lack or natural melatonin. I would first try less invasive methods to help her wind down (ie. a spoonful of honey, a turkey snack, a warm bath, complete darkness in the room). Is she getting enough outdoor time during the day (especially in the mornings). Spending time outdoors in the sun during the early morning (ie. when you first wake up, 7-9 AM) can help reset a mixed up biological clock.
Also, look at her naps and what time she goes to bed. Does she nap? What time and how long? Are your expectations for bedtime reasonable. I've known people who had a 2-yo who napped from say 2-4 and they expected them to go to bed again at 7 or 8. That may not be reasonable for all 2 year olds, they need more time awake before they are able to sleep again.
Does she need parental help to fall asleep. I know many 2-yos who are rocked/nursed/laid down with, back patted, etc. until they fall asleep.
Is she perhaps staying up too late and is overtired and gets her "second wind"?
I think the melatonin is fine sometimes, but I would work really hard not to become dependent on it.
I would also maybe try a homeopathic remedy and see if that helps. I know hylands makes hemopathic remedies for sleep.