@Rolian Maybe I spoke too soon before understanding. I had thought the Command-9 and Command-0 applied only to the item you were working on/had previously selected. I understand your comment to apply more to the the Control-Command-9 and Control-Command-0 keyboard shortcuts.
I think (but am not in a position to check right now) that an “item” such as a project with some action groups, for example, can be partially expanded as well, and so my point would go to Command-9 and Command-0 shortcuts as well. Of course, another approach along the lines of what you suggest, would be to have the toggle and perhaps have to toggle twice (eg to fully open and then fully shut, or vice-versa, depending on what the default would be in the event of partial expansion), but I think some people would find that confusing. You could probably accomplish that with a Keyboard Maestro conflict palette, though.
Well, I just learned something too. An item that has some sub-items expanded and some not, can’t be expanded (i.e Command-9 Expand Item menu is grayed out), but it can be collapsed. BUT, if you do collapse it, Command-9 will reopen it with only the previously expanded sub-item opening in an expanded state. The others still remain shut as they were when the Collapse Item menu was invoked. I can see how that would be the desired behavior, but it is not what I would have guessed had I not tried it. So don’t hold back with questions or comments!