First use always the Handlers
instead of the Listeners
the latter are deprecated.
I'm not sure if you mean by wait
to actual halt in the method, but that's never a good idea in JavaScript, because JavaScript is not multi-threaded.
As a idea for your question.The way I would approach it is, for each click mark the click event in a central class with some logic. All widgets that have click events call to this class to mark the click and the widget that clicked. Now each time a click from a widget is handled, the logic in the class calculates if a relationship must be formed, or if the state must be reset. For example. If the button was clicked it is marked, second if next two clicks are marked, at the last click the logic in the class now determines the relationships must be formed. By storing the widgets that clicked in the class when the click event is marked you can connect those widgets. I hope it makes sense, it's rather abstract.