Yeah because as soon as x is greater than room_width-10, it moves back flyspeed, so then it's less than room_width-100. So then it moves right flySpeed. But then it's greater than room_width-100, so it flies left flySpeed. Now it's less than room_width-100 again, so it flies right...
if median(x,100,room_width-100) != x
flySpeed = -flySpeed;
x += flySpeed;