Can I check for maintenance mode before redirecting to subdomain?

Each time that WordPress inserts a blog into maintenance mode, it creates a file in the root of your installation directory.

the file contains a string related to the plugin/theme/core that is being updated. Its name is .maintenance (doesn’t have a name, only extension).

The file stays there until the process is over, therefore you can check if the file exists by doing this:

if( file_exists(ABSPATH .'/.maintenance') ) { 
    // Stop redirection here
}

Which would be what you are looking for.

tech