Sound sensor read delay without delay

Hello! i want to read a sound sensor continuously but, when i get 1 from it digitalWrite() and stop reading for an interval of time without using delay(). I think is something like blink without delay but i can’t figure how to do it

I use this code but i want to get rid of delay.

int soundSensor=29;
int LED=26;
boolean LEDStatus=false;

void setup() {
 pinMode(soundSensor,INPUT);
 pinMode(LED,OUTPUT);
 Serial.begin(9600);

}

void loop() {

  int SensorData=digitalRead(soundSensor); 
  
  Serial.println(SensorData);
  if(SensorData==1){

    if(LEDStatus==false){
        LEDStatus=true;
        digitalWrite(LED,HIGH);
        delay(1000);
    }
    else{
        LEDStatus=false;
        digitalWrite(LED,LOW);
       delay(1000);
    }
  }
 
 }

Look at it this way:

  1. As fast as you can, thousands of times per second, read the sensor and turn on the light when it reaches the threshold.

  2. When you do turn it on, record the time and the fact that it is on.

  3. As fast as you can, check if the light is on. If it is on, look at the time since it went on. If it is more than the desired number of milliseconds, turn it off and record that it is off.

From there you can add extra details, like what happens if the sound level exceeds the threshold while the light is on? Does it extend the time or is it ignored?

i don't understand very well your explanation, please write a code whit your idea.

See the blink without delay example in the IDE or read State Machine