I understand where you're coming from but I assumed that setting the two output pins (8 and 9 on the L298) does just that?
{
digitalWrite(outPin1, LOW);
digitalWrite(outPin2, LOW);
}
What I'm having trouble with is triggering that command using the sensor.