Timer1 on Nano 33 BLE

No experience with the Nano33 BLE. That construction might not be supported by the Nano33 BLE.

Try to use a flag that you toggle and write that to pin 7. Something like

volatile bool pin7State= true;
...
...
void TIMER1_IRQHandler(void)
{
  if (NRF_TIMER1->EVENTS_COMPARE[0])
  {
    counter++;
    if (counter == 500) {
      pin7State = !pin7State;
      digitalWrite(7, pin7State);
      counter = 0;
    }
    NRF_TIMER1->EVENTS_COMPARE[0] = 0;
    NRF_TIMER1->CC[0] = 1000;
  }
}