you could just make a phasor at the rate of the square wave, and use the method thomas posted to make it square, and then use [wrap~ 0 0.5] | [*~ 2] to get the double speed phasor