The general advise is to create the mission XML directly and not use the API for creating missions. There are lot’s of areas that are not covered by the mission xml api and we are considering deprecating it entirely in future. So it might be better to switch to just creating XML for the allowed commands. The Marlo code for enabling / disabling commands is really hard to follow which might also be addressed with a more direct “generate the mission XML” approach.
Based on @AndKram 's feedback :