Need help with making a password circuit + writing code

What does your serial output look like?

You really should look at the state change detection example, to deal with when a pin BECOMES high, not IS high.