I disagree with this (seriously). The best way to wait, is to decide what conditions need to be true for you to continue. Then in your loop(), you don't fall into that code until those conditions are true. Let loop() run as fast as it can, and drive your application like a state machine.
Well, sure, but if you want to wait, it's with a while loop, not an if statement.
I agree, though, that it is nearly never necessary to wait, in the sense of doing nothing until a trigger condition is true. One can almost always do something else, even if that something else is just looking for something to do, until the trigger event occurs.
All I was suggesting was to work on one issue at a time. Connect the keypad. Write some code to read the keys pressed. Write some code to collect the key data in an array. Write some code to compare that data to a known value. When you can get a password, use ctrl-A, ctrl-X to delete that code. You know that that hardware works.
Now, write some code to read the key presses, whenever they occur, and do something with the data when it makes sense to.
When reading, for instance, one reads each character at a time, and forms words when it makes sense to, as in when a space or other punctuation occurs.
OP, you need to decide what that trigger will be. Perhaps the # or star key, if your keypad has them (with the other being the oops, back up one character key).