If you were to test this game out now, nothing would happen. Right now, it's like a piece of code in Scratch without a "when green flag clicked" or "when I receive message 1" yellow block. Code always needs an event to activate it, so create an event listener to activate the "open" function.
Connect your "upgrade" function when the door is touched. This is like making an imaginary Scratch code that says something like "When powerup is touched, upgrade player."