pulse sensor and ISR stops the rest of my code

I second DrDietrich's proposal of reply #3, except that "flag" should be declared volatile.

Everything that is now in the Timer2 ISR should be moved into the function T2SR(). Sadly, the developer of the pulse sensor does not understand very well how to program an Arduino.

volatile bool flag = false;
void loop(){
  if (flag) {
    flag = false;
    T2SR();
  }
}
ISR(TIMER2_COMPA_vect){
  flag = true; }
void T2SR() {