IC1 is a quad, two-input NAND Schmitt trigger. IC1A, R1, and C1 form a debouncer for S1. Switch S2 is debounced by IC1B, R2, and C2. IC1C, R3, and C4 form an oscillator that's used as the clock signal for the digital pot. The oscillator is controlled by the status of S1 and S2 through IC1D. If no switches are pressed, both inputs of IC1D remain at logic high. This causes IC1D to output a logic low, which inhibits oscillation. The output of IC1C remains at logic high. When S1 or S2 is pressed, IC1D's output becomes high. This change generates a high-to-low transition on IC1C's output. This transition forces IC2 to increase or decrease the wiper position of the pot by one step.
Holding down either S1 or S2 will allow the oscillator to continue running, stepping the pot's wiper position continuously. The oscillation frequency is around 3 Hz. Since the increase or decrease of the wiper position is controlled by the output of IC1B, pressing or releasing S2 determines the pot's direction.