First, I think the dynamic lists make a really slick UI. I came to this EUO party late (I wasn't playing 12-15 years ago and was not fluent in the scripting language), but I have often embarked on some personal project in the past several years only to discover TM did it way back when.

I will add that the recursion is something I never would have attempted - so definite kudo's on that aspect of this script.
I mentioned my attempts that have led me to think a redesign would be required to make it work. Specifically getting rid of any "menu delete" commands for buttons and adding a status of keeping track of whether the button has been already created within the script.
My work around for button issues is to create all necessary buttons in the original menu form creation.
Any buttons that are not needed with this initial menu creation, set the property to "invisible #false":
menu setprop BUTTONNAME visible #false
Then as a button would be swapped (deleted/created in the same place), set the old and new buttons to be appropriately visible:
menu setprop OldButtonName visible #false
menu setprop NewButtonName visible #true
This means that no buttons have the same name (because of delete/create logic) and the active buttons are available.
Following that recipe, I have no menu issues over #MENUBUTTON.
This recipe has the issue of the dynamic list creation means you may not know all the buttons required when doing the initial form creation. To get around this, setting a status that the button has been created would be a logical modification. Test for a variable which matches the button name (probably with a prefix) and either
create or do the
setprop visible options seems to me the best solution to allow the dynamic library to work seamlessly. Altering the
delete of the button would be required.
IMHO that is the best way to deal with the current ruleset of EUO and it's #MENUBUTTON idiosyncracies.
Gaderian