Does it have to be a double click?
You could get the same functionality by clicking on the viewport with a modifier.
You do not actually have to build a menu to take advantage of executing a command with a viewport mouse button click via popupMenu’s postMenuCommand. Just parent the popupMenu to viewPanes.
cmds.popupMenu( parent=‘viewPanes’, alt=True, SHIFT=True, button=3, pmc = yercommand )