It looks to me as though the op-amp is set up to detect the "delta-peak" condition at the end of the battery's charge curve.
I'd guess that S1 is a momentary push-button type of switch, and it is used to start the charge cycle. When S1 is closed, the op-amp's non-inverting input (+) will be pulled lower than its inverting input (-), forcing the output low. This in turn switches Q1 on, lights D3 & switches Q2 on to charge the battery.
At the end of the charge cycle, when the "delta-peak" condition occurs and the battery voltage starts to reduce slightly (even while charging), the change in voltage will occur quicker at the op-amp's inverting input (-) than at its non-inverting input (+), due to the much smaller value of C4 vs C3. This then has the effect of putting a lower voltage on the op-amp's inverting input (-) than that which is on its non-inverting input (+) which forces the output high - turning Q1, D3 & Q2 off.
R6 & D2 appear to hold the circuit in its off state until S1 is once again closed to start the charge.
D6 is placed in parallel with R8 so that C3 initially charges quickly to near the battery voltage when the charge cycle starts, but doesn't allow a quick discharge when the charge is near its end.
I agree with Matt B, that R7 & C2 serve as a switch-debounce.