Serial - Issues reading and parsing

Nick. You're a star! That did the trick. Got rid of my serial prints and threw a few LEDs onto a breadboard to debug and they show it's working. Looks like writing to the Serial Monitor caused the buffer to overflow (or something like that). Thanks!

For prosperity sake, I'll throw the working code up so it can help someone in the future. I'll add that credit goes to those who wrote this code. I've just added my bits to a sample already provided here.

#define SOP 's'
#define EOP 'e'

bool started = false;
bool ended = false;

char inData[20];
byte index;
int xVal=0, yVal=0;

int led1 = 8;
int led2 = 9;

void setup()
{
   Serial.begin(9600);
   // Other stuff...
   pinMode(led1, OUTPUT);   
   pinMode(led2, OUTPUT);   
}

void loop()
{
  // Read all serial data available, as fast as possible
  while(Serial.available() > 0)
  {
    //blink();
    char inChar = Serial.read();
    if(inChar == SOP)
    {
       index = 0;
       inData[index] = '\0';
       started = true;
       ended = false;
    }
    else if(inChar == EOP)
    {
       ended = true;
       break;
    }
    else
    {
      if(index < 19)
      {
        inData[index] = inChar;
        index++;
        inData[index] = '\0';
      }
    }
  }

  // We are here either because all pending serial
  // data has been read OR because an end of
  // packet marker arrived. Which is it?
  if(started && ended)
  {
    // The end of packet marker arrived. Process the packet



        char *name = strtok(inData, "=");
        while(name)
        {
          char *valToken = strtok(NULL, ",");
          if(valToken)
          {
             int val = atoi(valToken);
             if(strcmp(name, "X") == 0)
             {
                xVal = val;                
                digitalWrite(led1, HIGH);
             }
             else if(strcmp(name, "Y") == 0) 
             {
               yVal = val;
               digitalWrite(led2, HIGH);
             }
             // More else if's go here
             
          }
        
          name = strtok(NULL, "=");
        }
        
        digitalWrite(led1, LOW);
        digitalWrite(led2, LOW);
       
     //Serial.print("Xvalue= ");
     //Serial.print(xVal);
     //Serial.print("  Yvalue= ");
     //Serial.println(yVal);     

    // Reset for the next packet
    started = false;
    ended = false;
    index = 0;
    inData[index] = '\0';
  }
 
}

void blink()
{
  digitalWrite(led1, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(5);               // wait for a second
  digitalWrite(led1, LOW);    // turn the LED off by making the voltage LOW
  delay(5);               // wait for a second 
}