How to add a yield before else if?
First of all do yourself a favour and listen to your IDE 

This report would have more information with
 "Show verbose output during compilation"
option enabled in File -&gt; Preferences.


and in an if else there is no in between so either let it run as a state machine especially inyour case A != B != C != other:

void subfunction(){
  if(A){
  // code to run
  return; 
  }
 yield();  
 if(B){
  // code to run
  return; 
  }
 yield();
 if(C){
  // code to run
  return; 
  }
 else{}  // to catch if not A or B or C
 yield();
}


or implement switch case (Pseudo code)

 switch(fromClient){
    case "LR":
      //code to run
      yield();
      break;
    case "RR":
      //code to run
      yield();
      break;
    default:
      //code to run
      yield();
      break;
  }


Id else chains are prone to errors as in your case its A != B != C != other