Why is Mail app taking ages to setup my new Apple ID?
I don't think closing the window "messes up" anything.
Either your Apple ID is created, or it's not!
Check if you can login using your Apple ID in related services like iTunes Store. If you can't login, then there was an error on Apple's side and you can repeat the process again. On the other hand, if you can login, then your Apple ID is already created and ready to use.

The reason this kind of problems happen is mostly because of poor error handling. My best guess is timeout error which is very common, but the application (Mail.app in this case) doesn't know how to properly handle the error (and notify the user).

In your case, something caused the server's response (whether it be success or error) to not reach you, but the client side, is still waiting for server's response.