wire a button on the inside of the room to pin 2 of your arduino (to trigger an interrupt). You can either wire it so that when the button is pressed, the voltage drops to zero (pin High by default) or to 1 (pin low by default). Ensure you use proper wiring and pull up/down.
At the begining of your sketch declare a
volatile boolean needToUnlockFromInside = false;
in the setup, attach an interrupt function that will get triggered by pressing the button
attachInterrupt(digitalPinToInterrupt(2), unlockDoorFromInside, mode); // mode to match your button wiring
then write a function
which will Debounce (check in the last time this function was called is more than 50ms ago for example, I let you explore how you do this) and if yes, set the
needToUnlockFromInside = true; // button is pressed from the inside, need to unlock
then in the main loop add a piece of code checking that
needToUnlockFromInside flag and trigger unlocking if
true (and don't forget to also reset the flag to false once done)
you could improve your code a bit to accept variable length password by not hardwiring the 3 and use instead of
if (position == 3)
with something like
if (position == (sizeof(password) - 1))
You could also keep a global boolean variable to hold the status of the door (locked or unlocked) so that you don't send unnecessary commands to the servo if you are already in the correct position when you press '*' or '#'