If you use a microcontroller for your square wave, then simply generate your duty cycle from your microcontroller. Most microcontrollers have facilities to generate PWM signal at chosen frequency and duty cycle.
With MSP430, you would Configure your timer to some useful frequency superior to 1kHz. You configure the timer in up mode up to TAxCCR0 (capture compare). (count from 0 up to TAxCCR0 value repeatedly). Then you set to TAxCCR0 register to a value that will cause the frequency to be 1kHz. Typically, you want a clock of say 100 kHz. TAxCCR0 set to 100. Then you configure your TAxCCR1 register (second capture compare register) to some value between 0 and 100. This allows you to choose the duty cycle of your PWM between 0 and 100. You finally configure the timer to output TAxCCR1 to some pin in a way such that when timer value (TAxR) is between 0 and TAxCC1, the output is HIGH and when value is between TAxCCR1 and TAxCCR0, your output is 0.
You can change the values, but you get the idea. Other microcontrollers (AVR, PIC, ARM whatever) all have such timer modules. Registers just have different names and slightly different functionality.
Once you generate that signal, simply feed this to your circuit and it will work. By the way, instead of an operational amplifier, you should be using a comparator. It looks very similar, but operational amplifiers are designed for "analog" signals and are therefore usually slower than comparators of same cost/performance. Comparators are designed for digital signals, so they will more likely be "rail-to-rail" for a cheaper price and behave much better with sharp edges (square waves). Operational amplifier's slew rate (output rate of change) may well cause your signal to be distorted. Maybe this opamp you chose works at such low frequencies, I haven't checked at all.
If you want a more analog solution, then we need much more information about how you expect to "set/configure" the duty cycle.