digital read/write not working within switch/case serial loop

Are you sending it serial data while StopPin is HIGH? You have a requirement that there be two bytes (0 and 1) of incoming serial data while StopPin is HIGH in order to change modes.