You can have the buttons send a relay to a respective brick which toggles on and then makes it so that the next relay will direct in another direction in case of repeating numbers.
Then have a button which makes all the toggled bricks send out a relay to a wire that makes a brick in a sort of tube disappear. Afterwards, a radio wave would send across the tube, and if it hits the end, the door opens.
If the user presses an incorrect key, it resets.
The issue with this is a user can figure out which keys reset the thing and press them the amount of times needed.
To fix this, you could event it so only one is active the first press, then that one sets another to active, and so forth.
It's a bit more involved, but it should work if you know what you're doing, I believe.