ad 1) If array indexes are constant, like in
if (return_value[7] = $0A) and (return_value2[30] = $23) then
then IRP bit is not involved. On the other hand, if the indexes are unknown at compile time then such conditional cannot work properly and has to be modified, for example
STATUS.IRP:=1;
if return_value[i] = $0A then
begin
STATUS.IRP:=0;
if return_value2[j] = $23 then
begin
end;
end;
STATUS.IRP:=0;
ad 2) idx is just a name of a variable (short for index)

. To access the 5th byte of the array the variable has to have value of 4 (indexes start from 0).
Note that for the compiler
idx:=4;
return_data[idx]:=0;
is equivalent to
due to simple code optimization and thus the relevant memory byte will be accessed directly, regardless of IRP bit.