Take a look at the AATK Toolkit developed for the Xpedition flow (https://sourceforge.net/projects/uwtoolbox/files/latest/download). It has an excellent example .efm form for FlipChip packaging design you should take a look at (see below). All of the buttons launch VBScripts. There are a lot of scripts and so they have been grouped into categories and sub-categories. When you click on the "ROUTE" button for example, you get a sub-section of buttons displayed, specific to routing. Each button calls a VBScript file. Click on "DRC" and you get another list of buttons displayed. When the FlipChip form is loaded, it reads all of the commands from a XML file. In other words, you define what the buttons do from the XML file and the appropriate category and command buttons are loaded at run time.
To see it work, you need to install and setup AATK. i.e. you need to setup the environment variable AATK=<path to AATK>, and add AATK path to WDIR environment variable. The XML file is located in <your location>\AATK\FlipChip\FlipChipConfig.xml.
The coding for the .efm form is a little complex as it has to workaround some of the limitations of the emf development environment. So it may take a while to understand how it works. However, you could easily and quickly add/replace button commands simply by editing the XML file to add/remove commands as desired.