Serial.write stops working if not used?

  while ((Serial1.available() > 0)) {
    for (i=0; i < 15; i++){
    data[i] = Serial1.read();
    }
  }
    if ((data[0] == 's')){
    ...

Still reading 15 bytes of data after checking for only more than 0. If you know it's going to be 15 bytes, why not just wait until there is 15 bytes in the buffer instead of more than 0?

if ((data[0] == 's')){
      if ((data[1] == 'n')){
        if ((data[2] == 'p')) {

This should help shorten it a bit:

if (strncmp(data, "snp", 3) == 0)