I am using an Arduino Leonardo hooked up to two Mabuchi FC280-SA (2470) DC motors through an L298N. This is the data sheet for the L298N for reference:

I currently am using the following set-up to run the motors at different speeds relative to one another dependent on the feedback from two Ultrasonic Module Hc-Sr04 Distance Measuring Transducer Sensors for Arduino:
Pin 4 to a voltage an external power source (not the Arduino).
Pin 8 directly to GND
Pin 9 to +5v from Arduino
Pin 7, 12 to a digital output each
Pin 6, 11 to an analogue PWM output each
Pin 3,14 to a motor each
Pin 1,15 to GND with a very low 5Watt resistor each.
I am able to accomplish all my forward motion, turning, and stopping needs with this minimalistic set-up, but now I would like to implement a reverse function. I want the robot to reverse when both sensors fail their respective boolean functions, without requiring any action from an external user. What steps do I need to take to achieve this sort of reverse function? I'm willing to buy more parts if it's necessary.
I should add that I've owned an Arduino unit for all of a day at this point and have found these forums very helpful thus far, but I'm a total beginner who's just getting by with Google searches, a decent understanding of C language, and a bunch of patience.

