Sorry for not clarifying this initially.
Okay, so my code is essentially making a servo scan back and forth to its most outer limits, and I want to set up an interrupt for an IR Rangefinder or a PING type sensor. I want the interrupt to be able to stop the servo movement and hold position until nothing is seen by the sensor.