Circuit for determining the dc mean of a wave-form
To attempt to do this "well" in the analog domain could become complicated.  As I mentioned above, you'll need a way of resetting the op amp integrator, so that means a timer of some sort and a way of discharging the integrating capacitor, like a triggered JFET or MOSFET across the integrating capacitor.  You'll also need a sample-and-hold cicuit to sample the integrator output at the end of the integration time and hold it while the next value is being integrated.

On the other hand, it would be easy to implement your entire circuit using a 75 cent microcontroller, like the ATTiny13A.  Just apply your waveform (through whatever input voltage-division/protection network you desire) to the microcontroller's AD converter.  Sample the input to a buffer in software, long enough to get a full cycle, and then every so often calculate divide the sum of the samples in the buffer by the number and there, you have your average value.  Use the onboard PWM to convert this value back to analog (at a MUCH higher frequency so it's easier to fitler than a 3 Hz signal.) The tiny13 also has an onboard comparator, so you can then take your average value, which is now a DC voltage, and apply it to one of the comparator pins along with your original waveform.  An interrupt will be triggered every time the comparator toggles, if that's what you want, and you can then generate pulses or whatever you wish.