int time_threshold = 3000; //time in ms => 10 sec.
Wrong. If you are going to have comments, make them match the code.
int sensor = 12; // pin sensor is attached to
Variable names for pins really should have pin somewhere in the name. Did you really go to Radio Shack (or equivalent) and ask for a sensor? Or did you buy a switch? Make the name reflect the actual thing connected to the pin.
for (int i=100;i>5000;i++);
WTF?
do // You don't want to send out multiple SMSs.... or do you?
{
delay(1);
}
while (1>0);
Well, this would be why you never get another SMS.