Need help with making a password circuit + writing code

Yeah, that's probably a good idea. But first, this is the code I currently have and it works great:
#include <Password.h>

const int key1 = 7;
const int key2 = 6;
const int key3 = 5;
const int key4 = 4;

int key1State = 0;
int key2State = 0;
int key3State = 0;
int key4State = 0;

int lastKey1State = 0;
int lastKey2State = 0;
int lastKey3State = 0;
int lastKey4State = 0;

const int greenLed = 3;
const int redLed = 2;

int keyPushCounter = 0;

Password password = Password("1324");

void setup(){
Serial.begin(9600);

pinMode(key1, INPUT);
pinMode(key2, INPUT);
pinMode(key3, INPUT);
pinMode(key4, INPUT);

pinMode(greenLed, OUTPUT);
pinMode(redLed, OUTPUT);
}

void loop(){
key1State = digitalRead(key1);
if (key1State != lastKey1State) {
password.append('1');
Serial.println("1");
keyPushCounter++;
Serial.println(keyPushCounter);
delay(200);
}
key2State = digitalRead(key2);
if (key2State != lastKey2State) {
password.append('2');
Serial.println("2");
keyPushCounter++;
Serial.println(keyPushCounter);
delay(200);
}
key3State = digitalRead(key3);
if (key3State != lastKey3State) {
password.append('3');
Serial.println("3");
keyPushCounter++;
Serial.println(keyPushCounter);
delay(200);
}
key4State = digitalRead(key4);
if (key4State != lastKey4State) {
password.append('4');
Serial.println("4");
keyPushCounter++;
Serial.println(keyPushCounter);
delay(200);
}
if (keyPushCounter >= 4){
if(password.evaluate())
{
// turn one led on and the other off
digitalWrite(greenLed, HIGH);
delay(1000);
digitalWrite(greenLed, LOW);
password.reset();
Serial.println("Correct");
}
else
{
// turn the other led on and the first one off
digitalWrite(redLed, HIGH);
delay(1000);
digitalWrite(redLed, LOW);
password.reset();
Serial.println("False");
}
keyPushCounter = 0;
}
}

When I added a pushcounter (keyPushCounter) I could easily control when to evaluate the entered password, turn on/off the LEDs and when to reset the password. Thank you all for your help, this community is great!