You are on the right track, and yes you need a loop. However, whoever told you that using IF was lazy programming has no idea what they are talking about! Conditional execution is one of the cornerstones of programming. Example: what happens if you enter Y or Z? You go beyond the end of the ASCII uppercase alphabet. My idea is to cycle back to the start in that case so that ABCXYZ becomes CDEZAB and so on, and that requires use of IF.
Anyway, all you need is a loop to iterate over the characters in a string, convert them and put them back (looks like you need to read up on string use too)
procedure Convert(var s :string);
var
i :integer;
begin
for i := 1 to Length(s) do
if Ord(s[i]) >= Ord('Y') then
s[i] := Chr(Ord(s[i])-24)
else
s[i] := Chr(Ord(s[i])+2);
end;
Also note that you can use the result of Ord and Chr without storing them in intermediate variables.