Here's wiring for headlight relay. Which segments do you need?
I probably have it in this bag of non-essentials from my race-bike. All wire terminals were extracted cleanly from connectors with nothing cut. So you should be able to re-insert into your harness without any issues.
Melted wiring is just symptom of wiring problem. You should track down exact fault that caused wiring to melt, such as short somewhere. Perhaps PO tried to force headlight to turn ON with key ON because they couldn't believe that headlights only turned on when engine was running.