Sounds like you found the cause of the problem, assuming it is the only one. You were right to replace the switch and the terminal, but there should be two overheated terminals. The easiest is to cut away the melted part of the connector body and the two black terminals. Install the connector that way, with the two missing wires.
Those two wires will be hardened from overheating, for about the first four inches. Solder will not adhere to that. Cut that four inches off, then splice on a new section of the same diameter. Seal that with heat-shrink tubing. Never use electrical tape in a car as it will unravel into a gooey mess on a hot day. Use a universal crimp-on terminal, but also solder it to the new wire to insure it makes a solid connection. Plug that terminal onto the switch individually, then do the same thing to the other wire. Be sure those terminals slide on pretty hard so they make good contact. If they're loose, the resistance will create heat, and the problem will occur again. Squeeze the terminals a little with a pair of pliers if necessary to make them fit tightly.
If the intermittent problem is still occurring, connect a jumper wire to one of those new terminals, and run it out to where you can hook the other end to a test light. Tie up the test light someplace out of the way where you can see it. Observe if the test light goes out when the head lights go out. Once you know that, move the jumper wire to the other new terminal on the switch, and do that again. Knowing the results will tell us where to go next. At that point I will dig up a wiring diagram to see the correct wire colors.
Wednesday, February 15th, 2017 AT 3:08 PM