In 7, the menu item was simply "Toggle Enable", regardless of the state of the selection.
In 8, this has been replaced with more dynamic text. I don't have 8 in front of me, but I believe the wording would change based on whether it was already enabled or not, AND if there were multiple selections I think it says something like "Enable X macros" or "Disable Y actions".
How can I write an equivalent menu toggle in 8 -- one that works for the 4 dynamic situations I described?
You are far from the first one to encounter this issue. Here's a simple macro that I wrote back when 8.0 was first released that covers enabling and disabling macros, macro actions, and macro groups: