Its always an error to read more characters than are available:
while(Serial.available()) {
char inChar = Serial.read(); //if comment this 1
inData[index] = inChar; // and this 2
index++;
inString += inChar; //and this 3, buzzer will beep
if (Serial.read() == 13) { // \r cannot be detected if I were to use buzzer. Use 13
should be changed to something like this:
while(Serial.available()) { // pass this test, at least 1 char is available.
char inChar = Serial.read();
if (index < MAXCHARS) // check for buffer over-run.
{
inData[index++] = inChar;
}
inString += inChar; // why use string and String?
if (inChar == 13) { // compare the character actually read
and change
char inData[] = "";
to
#define MAXCHARS 50 // or whatever is sensible
char inData[MAXCHARS+1] ;