Add this after your module menu loop
<a class="menuMain" href="<{$xoops_url}>/modules/modulename/
I believe that this will always remain visible to everyone, even anonymous visitors. Meanwhile, in SystemAdmin > Modules > Order, be sure to make your created module have a zero, so it is not visible twice. Then, your permissions should take care of the rest.
Another way to accomplish that would be to make the system main menu not visible and use something else like Multi Menu in its place. Or, you could make the replacement menu only visible to anonymous visitors. Whatever works best.
Just suggestions.