There is something like this called the “OSC Pulse” event node (Events/Other). It works with an animation curve (which you can modify) that is evaluated repeatedly and returns the value of the curve. It also has two output event calls “High” and “Low” for when the value is above and below 0.
Let me know if this node works for what you want to achieve. If not, we can make a new one that fits your use case better.