I tried out some GUI scripting and couldn't manage to activate the Dock (in Ventura). Perhaps someone else will have more luck, but in the meantime, what's the end goal of opening that menu? There might be a more direct way to do what you'd like to do.
Trigger the macro and you will be presented with a list of the current application's visible windows. Choosing one from the list will bring it to the front.
Better Touch Tool lets me open that via the "show window switcher for all open apps option"
It used to look different. In the past. And I always wondered, whether it was a BTT feature or a macos feature. The problem used to be that it opened too slowly, but now it's fast enough.