Display problem involving delay function

I am writing code that displays several messages therefore needs a delay so the user can read both before moving on. In the first case (picture below) if the delay isn't there the "ready to lock keys" does not get printed.
In the second case (second picture) the 2 messages bounce back and fourth on the display between "ready to lock keys" and "enter pin"

Any suggestions on how to get it to display the first message, have a display, and then display "enter pin"

code 2.txt (23 Bytes)

Welcome to the forum. Please post your code as text within code tags, it's the </> button in the text editor. It is a lot easier for people to help you if they don't have to look at images of code or download anything.