Loops

In the middle of my sketch I want to make a loop that starts when i push the push button and then stops when I press it again, how can this be made?????

#define LED 13 // THE PIN FOR THE LED
#define SENS1 0


//VARIABLES 
int state = 0;
int currentInput = 1;
int currentOutput = 8;

int sensorValue = 0;
int oldSensorValue=0;
boolean blinking = false;


void setup () {
 pinMode (8, OUTPUT);
  
 pinMode (1, INPUT);
}

void loop (){

 oldSensorValue = sensorValue;
 sensorValue = digitalRead(currentInput); 

 if(sensorValue == HIGH && oldSensorValue == LOW){
   state= 1-state;
      digitalWrite(currentOutput, HIGH); 
 if(sensorValue == HIGH && blinking == true){
      blinking = false;
    }
    else if(sensorValue == HIGH && blinking == false){
      blinking = true;
    }
      
    }
 if (blinking == true) {
    digitalWrite(currentOutput+1, HIGH);
    delay(200);
    digitalWrite(currentOutput+1, LOW);
    delay(200);}
    
else if (blinking == false && sensorValue == HIGH){
   digitalWrite(currentOutput+1, HIGH);
   digitalWrite(currentOutput+2, HIGH);
   delay(200);
   digitalWrite(currentOutput+2, LOW);
   delay(200);}  
 }

what happens is that when i press the button, my first led goes on permenantly and the second goes blinking (which i needed and is correct) the problem is that i want when i press again the second led to stay on, the first led to keep staying on and the third goes blinking and then the same process with the fourth......... but what happens is that when i press on the button the second keeps lit steadily and the first keeps lit steadily but the third blinks once then stops... (which is my problem)

You have a number of problems in your code.

Why do you define variables for "currentInput" and "currentOutput" but then don't use them in setup()? Later in your code you use things like "currentOutput+1" and "currentOutput+2" but you never defined their pinMode() to be OUTPUTs. (e.g. if currentOutput is 8, then you also need to define pins 9 and 10 as OUTPUT, which I don't see.)

Unless you explicitly set the pinMode() to OUTPUT, all pins act as INPUT.

What button are you referring to? Is it connected to the pin/variable called "sensor"?