Solved!
I do not know whether the approach I followed is right. But it for my issue atleast, it worked.
To check if the message is under re-process mode, I queried on BALHDR table with the AIF message ID as EXT number and object as ´/AIF/LOG' to check if any log exists already for the same message.