Hooray!! Congratulations, aidzmana! Best wishes to you. :D
Kampai: 1. A toast, the Japanese equivalent for "Cheers!".
2. To celebrate, or to have a party.
Connecting one leg of the capacitor to the input of the first inverter (pin 1 of ic2) and the other leg to the output of the second inverter (pin 4) provides positive feedback to reset the capacitor when the delay times out.
Here's a rough timing diagram:
At time t0, the input (pin1) is high and so is the output (pin4).
At time t1, the sensor is triggered and pin 1 is pulled low by the comparator's output. Pin 4 goes low as well. The voltage at pin 1 now starts to rise as the capacitor is charged via the 100k resistor.
At time t2, the capacitor voltage rises to the upper threshold of the 74HC14's input which sends pin 4 high again.
Pin 4 is capacitively coupled to pin 1 and, as it goes high, it drives pin 1 high as well. The charge on the capacitor is clamped and dumped on the positive rail via the internal input protection diodes of the 74HC14.
Without the positive feedback of pin 4, the voltage at pin 1 (especially when using the 1 Meg resistor, it seems) can just hang around the switching voltage of the input, reacting to motor and switching noise, and refusing to rise any higher. This leads to a sort of chaotic oscillation of the motor drive, and the poor old motor blurps and farts away unable to decide which way to go.
With the cap attached as it is in the schematic, clean switching occurs between forward and reverse.