Code:
if (R5Direction='RIGHT')then 
  begin 
    X:=x+Speed1*dx; 
    if (X>GameAreaX2-Image.width)then 
    begin
      r5direction:='LEFT'; 
      exit; // <---------------------- I forgot this &#58;&#41;
    end;
  end;