Excellent line of thinking.
They had a keypad on the outside on the German plane.
The co-pilot overrode that function with a standard 20-minute lockout. That’s to keep terrorists from getting the keypad cose and gaining access from the cabin. The 20 minute lockout can be renewed indefinitely.
He crashed the plane in 18 minutes.
To my chagrin, I just saw on TV they already have the keypad on the cockpit door. Also that there is no evidence that the pilot entered any number code in an attempt to open the door. But they also said that the person inside can overcome attempts to open with the keypad. That strikes me as defeating the purpose, which is no surprise. It was designed by government.