AG, the OP has tried what you suggest as the alternative to use of a 4093 and it doesn't work with the optosensor
. Simulation suggests this is due to insufficiently sharp-edged input pulses: hence the use of the Schmitt-action 4093. See post #110 et seq. Thanks for adding the "internals" to the 4093 symbol.