basic arduino project (Input counter) Is my code correct ?

Hey guys ,
so im working on my first Arduino project which is to make a buzz wire game and need help with the coding.

When the wire touches the loop input is sent to pin2. So far im able to light up led pin 13 whenever the wire touches the loop with the following code

int buttonState = 0;
void setup() {
 pinMode(13, OUTPUT);
 pinMode(2, INPUT);
}
void loop(){
 buttonState = digitalRead(2);
 while (buttonState == LOW) {
 digitalWrite(13, LOW);
 buttonState = digitalRead(2);
 }
 for ( ; ; ) {
 digitalWrite(13, HIGH);
 }
}

My next step is count the number of times input is detected. To do this ive just edited the existing code with bits of code from ButtonStateDetection example.

Unfortunately i dont have my arduino with me currently so i cant test any of the below code. Im wondering if it looks right ? what am i doing wrong?

// this constant won't change:
const int  buttonPin = 2;    // Input
const int ledPin = 13;       // the pin that the LED is attached to


// Variables will change:
int buttonPushCounter = 0;   // counter for the number of button presses
int buttonState = 0;         // current state of the button
int lastButtonState = 0;     // previous state of the button

void setup() {
  // initialize pin13 as an output: 
 pinMode(ledPin, OUTPUT);
 // initialize  pin2 as a input
 pinMode(2, INPUT);
 // initialize serial communication:
  Serial.begin(9600);
}


void loop(){
  // read the input pin:
 buttonState = digitalRead(2);
 
  // compare the buttonState to its previous state
  if (buttonState != lastButtonState) {
    // if the state has changed, increment the counter
    if (buttonState == HIGH) {
      // if the current state is HIGH then the button
      // wend from off to on:
      buttonPushCounter++;
      Serial.println("on");
      Serial.print("number of touches:  ");
      Serial.println(buttonPushCounter);
    }
    else {
      
      Serial.println(" ");
    }
    // Delay a little bit to avoid bouncing
    delay(50);
  }
  // save the current state as the last state,
  //for next time through the loop
  lastButtonState = buttonState;
 
 while (buttonState == LOW) {
 digitalWrite(13, LOW);
 buttonState = digitalRead(2);
 }
 for ( ; ; ) {
 digitalWrite(13, HIGH);
 }
}

After this is complete i would like to add a timer to my game with every touch being a time bonus. As in have a timer counting how long someone takes to finish the loop (Have a stop button) and with each touch (Pin2 input) add 2 seconds to the timer, would this be difficult to code ?