arduino gsm door alarm

I took this thread and got it working. I do not have a GSM shield so replaced the SMS code with a simple LED connected to pin 8. Now when the door is opened longer than 10 seconds the LED will blink once. If the door is closed and then reopened the LED will blink again after 10 seconds.

 int doorContactPin = 2; // pin door contact is attached to
 int ledPin = 8; // led connected to pin 8 thru resistor to gnd
 unsigned long doorOpenTime = 0;
 unsigned long doorClosTime = 0;
 unsigned long time_threshold = 10000; //time in ms => 10 sec.
 int currDoorState = digitalRead(doorContactPin);
 int prevDoorState = digitalRead(doorContactPin); // Assumes that LOW means closed and door is closed when the Arduino starts
 boolean DoorIsClosed=true; // Let's assume it's closed for starting
 boolean SMSSent=false;     // Tells us whether we've sent an SMS for the latest instance of the door being open

void setup()
{  
 pinMode(doorContactPin,INPUT);
 pinMode(ledPin, OUTPUT); 
}


//next function was for sending an SMS but I didn't have one so replaced the code with a simple LED on/off
void sendSMS()
{
 digitalWrite(ledPin,HIGH);
 delay(500);
 digitalWrite(ledPin,LOW);
}

void loop()
{
currDoorState = digitalRead(doorContactPin);
if(currDoorState != prevDoorState)   // Door was closed and is now open or door was open and is now closed
  {
  if(currDoorState == LOW)
    {
    // Door is now closed
    DoorIsClosed=true;
    }
  else
    {
    // Door is now open
    DoorIsClosed=false;
    doorOpenTime = millis();
    }
  SMSSent=false; // Door state changed, we may have a new opportunity to send SMS
  }
prevDoorState = currDoorState;

// Now see if the door is open
if(!DoorIsClosed && !SMSSent)
  {
  if(millis() - doorOpenTime >= time_threshold)
    {
//    digitalWrite(ledPin,HIGH);
//    delay(500);
//    digitalWrite(ledPin,LOW);
    sendSMS();
    SMSSent=true;
    }
  }
}