From HONDAMAN......
This sounds a lot like a bad keyswitch. The contacts inside can get worn and the little springs loose from years of heating and corrosion: they were not especially expensive materials inside. Oftentimes, the contacts in the plug also get corroded and loose enough that they can back out of the connectors and/or provide poor connection, which then heat up after it is run for a while: the expansion can then just barely break open the circuit. Wiggling the connector then makes it contact again after it has cooled off a bit, and the cycle repeats.
...it's an age thing...
The wiring codes: the RED comes from the battery, normally via the main fuse.
The BLACK connects to RED when the key is in the middle position. BLACK is IGNITION power all over the bike, for the coils and headlight, and turn signals.
The BROWN/WHITE wire connects to the BROWN wire when the key is in the middle position and connects to the RED wire in the PARK (up) position. This is the power to the tailight circuit. The BROWN comes from the headlight switch, which gets it power from BLACK when the key is in the middle position and the headlight is ON.
You can try manually jumpering the RED to the BLACK and the BROWN to BROWN/WHITE and take a test ride to see if it settles down: if so, just get a new switch. If you can't find one with the right connector, get one from a 750/500/550 and then go to
www.vintageconnections.com to get new connectors for about $10, total.
Also, don't overlook the little bullet connectors inside the headlight: they get corroded and need to be cleaned once or twice a decade. A few bikes also break the wires inside their jackets at the steering head: I've seen that a few times. This one is easy to figure out: turn the bars to one side and wiggle the wires at the head to see if the power comes and goes, track it down from there.