How about a script that causes the back button to be pressed when the M key is pressed with map open, so it closes the map without having to script the entire map closure again? I have no experience with scripts, but this seems like the most simple idea to me.