I don't prefer melatonin at all. I think it works mostly on circadian rhythms and if they aren't too jacked up then I'm not sure the benefit. I know research shows it helps you fall asleep and helps you stay asleep, so maybe there's something to that, but I don't really have a major sleep issue so I don't know. people love it so don't listen to me on its effectivness.
assuming it's a good supp for general sleep issues, all of the sleep aids, melatonin included should be cycled on and off. when I'm in a really bad way I use valerian root, kava extract (pure noble strain), or a supplement that has Taurine, L-Theanine, L-Glycine, 5-HTP, L-Glutamine, Vit C (insubstantial), Vit B6, 3mg of melatonin (and a small dose of essential amino acids). Those combined ingredients are foundational to good sleep. The traditional sleep hygiene stuff doesn't really help with light sleep, easily awakened, but you gotta do that too. being physically worn out but not distractedly sore from exercise is my best bet too. not eating heavy or late is a big one too. I'd have no problem with 3mg or less of melatonin provided I cycled it on and off with a good month off before trying again. but that's just me.
The thing about the increase in heart failure is isolated - sleep problems alone have that problem too. but then add all the things you do to reduce those risks. exercise is X% reduction in risk, eating healthy is Y% reduction in risk, drinking less then 4-6 servings of alcohol is Z% reduction in risk, and the list goes on and on. If melatonin truly helps you sleep I'd bet good money its risk for heart failure is counterbalanced by the benefits of your good sleep when you take it - or at least your improved sleep.
I wouldn't go above 2-3mg though and one of my doctors told me that, don't remember which one (coulda been my cardiologist).