Program freezes after a while

Do you have any way to get debug info out of the system? If not, I'd be inclined to use softwareserial to talk to the other arduino and leave the hardware serial port free for debugging. I'd be interested in the value of switch_count. Depending on the setup in EEPROM, it looks like there is potential for it to be greater than max_switches.