How are menus rendered?
_menu_tree_check_access() should go a long way towards understanding what Drupal does internally.

It declares a new array of items, then loops through each item currently in the menu and checks access. Only if the current user has the correct access is the item added to the new array. At the end of the function, only the new array is returned. So Drupal's method is actually a bit more low-tech than I think you were going for.

Just so the process is a bit more obvious the functions are called in this order:


menu_build_tree() calls
menu_tree_access() which in turn calls
_menu_tree_access()


If you're looking to emulate the way Drupal builds its menus, I think menu_build_tree() is probably the best place to start.