I have a somewhat similar requirement to you. Currently I am using the below to test for the correct scenario:
if ( is_user_logged_in() == true ||
in_array($GLOBALS['pagenow'], array('wp-login.php')) ||
strpos($_SERVER['REQUEST_URI'], 'wp-admin') != 0)
This doesn’t detect if you have changed the login URLs but you could define Globals or plugin variables to specify ‘wp-login.php’ and ‘wp-admin’ strings so that they can be more conveniently controlled, albeit manually.
I’m not convinced its the neatest solution but its the only one I have at the moment and seems to do what I need. Perhaps it helps?