That's a huge amount of scripting. Frankly you'd be better off just writing your own addon instead of going through kgPanels to make option buttons, frame toggle buttons, etc. You clearly understand enough WoW programming to write those scripts; creating franes is not really any more complicated than that.
Anyway, I only got through the first few hundred lines of scripting (and that was after spending 10 minutes removing all the non-script junk from the SV file), but I didn't see anything that should be tainting anything.
You could try enabling taint logging and checking the log to see if anything related to kgPanels comes up. See:
http://www.wowpedia.org/CVar_taintLog
Finally, you might consider submitting a ticket on the kgPanels project page over on WowAce. The kgPanels developer(s) will probably have a much easier time scanning your scripts and identifying any possible issues, since they know exactly how the addon works and how it handles scripts.
Oh, and I forgot to ask if the problem still happens when kgPanels (with your scripts) is the only addon loaded.