You can't directly execute code that is in a string.
The "data" field of the 'new menus' should be used to keep appropriate associations between the options in the menu and the menu handler.
So, you would need one array for the menu options and another for the unique data identifier (this value will be an integer that will be used in the switch of the menu handler). Simply get your random value with what ever method you want. Use that cached random value to register the menu item with the menu option and the data identifier.