step = (Math.abs(step)%4)
step не будет равен 4 никогда. Например, так step = (Math.abs(step)%5)
Program arrays;
var a : array [0..3] of integer;
var b : array [0..3] of integer;
i: integer;
j: integer;
procedure FirstProcedure(a,b: array of integer);
begin
writeLn(a[1] + b[2]);
end;
begin
for i:=0 to 3 do
begin
writeLn('WHAT IS A', i, '?');
readLn(a[i]);
end;
for j:=0 to 3 do
begin
writeLn('WHAT IS B', j, '?');
readLn(b[j]);
end;
writeLn(i);
writeLn(j);
FirstProcedure(a,b);
readln();
end.