Why does pulse sensor shows gaps when I move it?
One of the possibilities is when you move your finger, the sensor grip loosened and doesn't count a "beat". So the sensor emits data = 0, and it will cause 

Serial.println("");    


in your switch-case.