I am not sure that's the right way to read the IR Seeker sensor. Please take a look at Xander's sample code hitechnic-irseeker-v2-test1.c, especially the function HTIRS2readDCDir. I haven't tried reading the raw value from the sensor, does it really give you the value 1-9? I noticed the HTIRS2_DC_DIR register is at offset 0. I don't know if SensorRaw will read the value at offset 0 for you. In any case, Xander's sample code also configures the IR seeker sensor. Your code did not. It may as well be that the default configuration is fine, but I would init it properly just to be safe.
Also, you should avoid nesting while loops like that. Try this instead:
Actually, like Mentor3923 said, I don't know what your code is trying to do nor do I know what AoD is for. motorA and motorB do not appear in your pragmas and they don't seem to be the wheel motors. So I took the liberty to interpret what you really meant. It is still incomplete because the above code does not have a "stopping condition".