There was a similar question here: How to listen for whether the option key is pressed in the right-click menu? - #2 by FlorianPircher
There are many plugins that add a menu item. One example: Arrange-Windows/ArrangeWindows.glyphsPlugin/Contents/Resources/plugin.py at ff44224492574c12ff8ad82db7a825189d92b0f9 · Mark2Mark/Arrange-Windows · GitHub