if i remove this code should i expect to get SMS each time the door is opened?
No. You should expect to get that over and over as long as the door is open.
Now, you need to learn about saving the previous state of a pin, and detect transitions. You want to send the message only when the switch pin transitions from released to pressed.