escaping loop, or replacing loop ( adalight code)

Good day. Im new here, but a long time reader and a long time user of arduino, but i still consider myself nooob. I try now to make some PC lights, and a part of it involves using the adalights with the ambibox software. But, that is optional. and only as a function, that is used when i have serial active. Ive made the code modular already, so no point into posting all the code , as the rest of the code are fastled effects etc.
My problem is the following: when i select the Serial function (will post code) which is the Adalight code, i got from someone else, it works perfectly. but, when i select something else, this code get stuck in a waiting loop, thus then next selected function does not work.

 void serial () {
    // wait for first byte of Magic Word
  for(i = 0; i < sizeof prefix; ++i) {
    Serial.print ("must escape this");
    waitLoop: while (!Serial.available()) ;;
    // Check next byte in Magic Word
    if(prefix[i] == continue;
    // otherwise, start over
    i = 0;
    goto waitLoop;
  // Hi, Lo, Checksum
  while (!Serial.available()) ;;;
  while (!Serial.available()) ;;;
  while (!Serial.available()) ;;;
  s = 1 ;
  // if checksum does not match go back to wait
  if (chk != (hi ^ lo ^ 0x55))
    goto waitLoop;
  memset(leds, 0, NUM_LEDS * sizeof(struct CRGB));
  // read the transmission data and set LED values
  for (uint8_t i = 0; i < NUM_LEDS; i++) { // replace for with if here
    byte r, g, b;    
    r =;
    g =;
    b =;
//Change Variables to match output if strand is mismatched or try changing order of rgb in controller definition at top
    leds[i].r = r;
    leds[i].g = g;
    leds[i].b = b;
  // shows new values;

my question is:
is there a chance i could modify the code to make this not use a loop?
i want to say that i dont care about how fast it will work, because it will just do colour changing.
kind regards, Loren

is there a chance i could modify the code to make this not use a loop?

Of course you could. And should.

The label and goto statement instead of a while loop tells me that you haven't a clue what you are doing. Get rid of them, and use a while loop, to stop giving that impression.

Then, ask yourself why you need to sit around with your thumb up your ass, waiting for serial data to arrive. That's like sitting next to the phone, chanting "ring...ring...ring". Get a life. Answer the phone/deal with serial data when it arrives. Don't sit around waiting for it.