Sounds like a bad horn, shorting out, intermittently open circuit. I'd replace the horn with a known good unit. Then re-check your wiring, to make certain you have good connections -- crimp-on connectors can be flaky; soldering them is best, using electronic, rosin-core, solder only. Best of luck. Cheers!
1979 CB750K (sold, 2012, but not forgotten)
1983 Kawasaki 440 LTD Belt Drive (sold, 2011)
1993 Kawasaki Voyager XII