Serial.write("AT+CMGF=1"); //Use text mode for sms
Serial.write("AT+CMGL=\"ALL\"\r\n"); //Check which AT commands that will send you the first sms in the sms memory. If there is none you will get an error, but that is ok.
delay(1000); //Wait for modem to send response
a = Serial.read(); //Read the modem response
if ( a.find("off") ) //If off is anywhere in modem response,
servo(0); //move servo to zero degrees
if (a.find("90") ) //If 90 is anywhere in response
servo(90); /Move servo to zero degrees
Serial.write("AT+yyyyy\r\n"); //Check which AT commands delete the first sms
delay(1000); //Wait for modem response
Serial.read(); //Read and throw away modem response
I don't think you need to initialize the modem to send you notifications if there is an incoming sms. Just loop and check if there is an sms that contains the keywords to act upon.
Then delete all sms's as they might fill up the sms-memory in the module.
You are just sending very short messages so I guess the read-buffer can handle this.
You are just sending a single sms not very fast so you can afford the wait between receiving a sms and deleting it. If you send sms to fast, you might delete an sms with a new command. Can be handled but require more checks...
Most SMS-commands are standardized, random google link might be useful http://www.developer.nokia.com/Community/Wiki/Using_AT_commands_to_send_and_read_SMS
But you need to verify the AT-commands with your paritcular modems AT-commands.