I originally asked this over on electronics.stackexchange.com, but they don't seem to have the skills to figure out the correct way to wire this situation. Someone suggested I post it here instead.
Above is the way it is currently wired. What I am looking for is guidance on the correct way to wire it. The main issue seems to be that the power line is coming into the gang box on the right. There wouldn't be an issue if there was a power line coming into the gang box on the left and a separate power line coming into the gang box on the right, but that isn't what I have. Is there a way to wire this up correctly, or do I need to run a new power line from the panel to the gang box on the left? That would be... unfortunate since it is a run of about 70 feet and I'd have to go through walls.