The solution should work for two (or more) levels. This functionality is addressed in the description 'Aspect 1' as well as the source code above it.
In 'Aspect 1' you will find the necessary adaptation to allow a top-level menu to open a sub-menu. This will work with shortcuts. In the source code above you will find a code starting with comment 'The range of shortcuts from the e.g. 'picture menu''. The following code opens the top-level menu and feeds it with a shortcut to open the next menu.
Let me know if you need more details.