Maybe this is of use, i.e. the last example to show/hide non-nested menu items acc. to some condition (in your case: a check of the name of $active or $menu) with a group.
Afaik you cannot prevent the display of menu items that are added by another script (e.g. the "default" popup definitions) with mIRC commands (especially as all popups are created according to the "load order" of the files). There may be some dll for it though.