Both of the above replies will work, but there is a disadvantage also. Once an AI ability is disabled it cannot be re-enabled without killing and resurrecting the unit (unit setDamage 1; unit setDamage 0). Killing and resurrecting the unit will then prevent that unit from ever being targeted by another AI unless you first set him to captive before killing him
unit setCaptive true
;delay needed to let the game engine have time to acknowledge the unit is captive
unit setDamage 1
unit setDamage 0
unit setCaptive false
Another way to make him not look at other units is to set his behavior to careless and command him to look at the position in front of him
unit setBehaviour "careless"
unit doWatch [(getPos unit select 0) + (100 * sin (getDir unit), (getPos unit select 1) + (100 * sin (getDir unit), 0]
To undo him from watching this position and make him behave properly toward enemies you would command him to watch nothing and set his behavior to safe or aware.
unit setBehaviour "safe"
unit doWatch objNull