reading sms

maybe my delete command wrong;

One can help with coding without understanding which AT command does what. You should have functions that send exactly one AT command. The name of the function should clearly reflect what the AT command being sent does.

If

  Serial.println("AT+CMGR");    //Reads the first SMS

reads the message, and

  Serial.println("AT+CMGD=1,4");

deletes it, then, yes, you have a problem with the delete command.

data no longer gets a value, because you no longer actually read anything. So, the fact that sending the Arduino a SMS causes nothing to happen is not really surprising.