You should use code tags for code in your post. That is the # button when you are editing your post.
I have run auto format (as suggested by others) and it is clear that the logic may not be what you expect:
waiting = false;
I am pretty sure that the servo movement code should be in the 'if' statement if the color sensor has completed reading, with the Serial.print() statements, not outside it. This is probably not your problem but untidy practice. I have also eliminated the double declare of the rgb variable with one in scope for the else part of the statement.
Also I see no logic to move the servo back to any other position once it has moved the first time, so it will appear to be still.