I won't say that it can't be done, but this will be extremely difficult, as you probably have to override the generation of the menu, which is some pretty complicated stuff.
An alternative and much easier solution would be to have both menu items in your menu, but to hide one of them.
If the user just needs to be logged in you can check the body class, as it by default will put a class to show if the user is logged in or not. You can use that to make two different styling rules, hiding the menu item that shouldn't be displayed to user.
If the access check is a bit more complicated, you can do it in the preprocess_page
function in your theme and add extra classes to your body tag.