($100 paid request) Serial/SafeString/Digital Read/Write bug is ruining my life

Have you considered dropping the ascii representation for the various actuators and sensors, and instead sending binary data? It would be easy enough to send a fixed number of bytes, with one bit per actuator to indicate actuator open/close position, and one bit per sensor to represent which if any sensor's data needs to be sent. That would greatly reduce the volume of serial data, and also eliminate the laborious text buffering and comparisons.

If nothing else, reduce the amount of characters being send, it is completely unnecessary to send five or six letters just to make the coding human readable, when a single letter would suffice for the number of actuators/sensors you are using. Same goes for sending the number after the ':' - it appears you are converting that into a long, then treating the number as a bool to set the relay on/off, implying all you will be sending is either a '0' or '1'. Much more efficient to just check for ASCII '0' or '1', or assume that the number will always be one of those two digits and subtract '0' to get 0 or 1.