This should do what you want. I didn't test it so it may not work. Just reply with the error message if it doesn't work.
local component = require("component")
local r = component.redstone
local term = require("term")
local text = require("text")
---- config section
local password = {
pw_open = "openMe",
pw_close = "closeMe"
}
local side = 5 --side of the door
-----
local open = false
local input_password
local function checkPassword(i_password)
if (i_password == password.pw_open & open == false) then
return true
elseif (i_password == password.pw_close & open == true