Undefined index: action with code-snippets to change register page

You’re doing this:

strtolower( $_GET['action'])

But you’re not checking if $_GET['action'] exists first. You can’t count on it being set, because when you visit wp-login.php, it doesn’t have ?action= in the URL, but this hook still fires.

So you need to add isset( $_GET['action'] ) to your conditions:

if ( 
    strtolower($pagenow) == 'wp-login.php' &&
    isset( $_GET['action'] ) &&
    strtolower( $_GET['action'] ) == 'register'
) {

}