the loop starts with
if (MYIR.decode(&results)){
A=results.value;
...
that means if I have received a command then I store in variable A the IR code I have received.
MYIR.resume(); means after I've dealt with a code, be ready for the next one
what you want to write is
while I've not received a code, I wait
Now that I've received a code, I check if it's the right one. if so I go to the loop, otherwise I resume waiting for the next code