Assuming you have some buffering so the comparators swing exactly 5V..
solving numerically to minimize the error squared of the two thresholds and the two hysteresis (using solver software)
R13 = 30.000K (defined)
R14 = 2.923256628K
R16 = 16.07788776K
R21 = 1142.70829K
R22 = 1061.133891
Obviously you could scale those values higher or lower. I happened to pick an exact value for R13, based on arbitrarily making the divider current about 100uA and thus having feedback resistors in the 1M ohm range.
That makes the voltages at pins 3 and 6 2.000 and 1.7000 with both outputs high- with the respective output low they each will switch 50mV lower- 1.9500V and 1.6500V
I simply calculated the current voltages given resistor values (assuming both outputs high), then calculated the two (high and low) resistances looking into the divider from R21 and R22, and from there the hysteresis with a 5V change- 5 * Rthev/(R21 + Rthev), for example.
To roughly estimate the resistor values, you can ignore the feedback (we know it's relatively small voltage change), assume a divider current of (say) 100uA and then you know that:
R13 = (5V - 2V)/0.1 = 30K
R14 = (2V - 1.7V)/0.1 = 3K
R16 = (1.7V)/0.1 = 17K
Just roughly, looking into the node at pin 3 and ignoring R22, we see R13 || (R14 + R16), so the feedback resistor R21 should be roughly 4.95/0.05 = 99 times higher, or about 1.2M. Similarly, looking into the node at pin 6 and ignoring R21, we see (R13 + R14) || R16, so R22 should be around 1.1M.
As you can see, those guesstimates are not far off at all, and it's possible to just fiddle a bit with them in Spice and get close enough that (say) 1% resistor tolerance will dominate.
C14 is a really bad idea- the op-amp will oscillate, also C21 and C22 are not a good idea either. To get the output to snap you should not delay the feedback.
So to close my own question, this was solved by the insights of noise on a trace given here
The oscillation happens because of parasitic capacitance between the output of the comparator and it's negative pin. Since I've had the input resistors of this pin close to the source, instead of close to the input, the signal source had a bad time trying to reject the induced noise.
This was solved with better layout and normal hysteresis.
Others solutions that would solve the issue would be lower value for those input resistors (lowering input impedance), or a better comparator IC with much higher input impedance - like the TLC372-EP (bigger output impedance)
Best Answer
An LM358 will function fine in this circuit, however the output rise and fall times will be limited by the slew rate of the op-amp, typical more than 15usec. That will limit the frequency response, and not all counters will be happy with such long rise and fall times in a clock input. For example, the 74HC4040 specified maximum is 139ns/volt, which is way (more than 20x) faster than the 0.3V/us typical slew rate of an LM358. It could be cleaned up with a Schmitt trigger gate if required, however frequency response is unlikely to be more than a few 10s of kHz.
Further limiting the input frequency response with an RC on the non-inverting input could be desirable in some cases (maybe ~10kHz or less cutoff). The reason for considering this is that the positive feedback is delayed by the glacial slew rate of the output, and in the meantime the comparator is vulnerable to fast variations in the input. Here is the response near switching of the comparator with about 0.23V of hysteresis, a slow input ramp with a 10kHz 0.2Vp-p square wave superimposed:
And the same with a 10K/1nF filter ahead of the comparator (16kHz cutoff).
As Nick Johnson says, an op-amp as a comparator is sometimes possible (some op-amps are even worse suited) but usually not desirable except in very special circumstance such as where precision is more important than speed.
Op-amps have front ends that may be ill-suited for large differential voltages (the LM358 is okay), and most are internally compensated for stability at unity gain so they behave quite sluggishly. In the old days we would sometimes use uncompensated op-amps as comparators, but there are much better parts available these days.