I'd like to add control of an additional light to my sketch...

void loop() {
  //App Inventor sends three bytes (RGB, 0 to 255).
  if ( BTSerial.available() > 3){
    //make sure it's 3 bytes
    if ( BTSerial.available() == 4){
      //read each of the 3 bytes for brightness into the variables
      redvalue=BTSerial.read(); 
      greenvalue=BTSerial.read();
      bluevalue=BTSerial.read();
      //flush the buffer
      BTSerial.flush();
    } 
    else {
      //if the data is not 3 bytes treat it as invalid and flush the buffer.
      if (byte(BTSerial.read() == 'A'));{
        
      redvalue2=BTSerial.read();
      greenvalue2=BTSerial.read();
      bluevalue2=BTSerial.read();
    }
        
      BTSerial.flush();
    }
  } 
  //write the current values to the pwm pins.
  analogWrite(redpin, redvalue);
  analogWrite(greenpin, greenvalue);
  analogWrite(bluepin, bluevalue);
  analogWrite(redpin2, redvalue2);
  analogWrite(greenpin2, greenvalue2);
  analogWrite(bluepin2, bluevalue2);
  

  
  switch (BTSerial.read()){
  
  case 1:
   digitalWrite(whitepin, HIGH);
   break;
  case 2:
   digitalWrite(whitepin, LOW);
   break;

  }
}

The if statements and the switch cases work individually but not as one whole program