To add some clarification here, this is what you're doing:
To get a link to open in a new page, the proper HTML is:
<a href="http://answers.squarespace.com/questions/23324/gallery-external-link-in-new-windowtab" target="_blank">Link</a>
Squarespace doesn't offer the "Open in new window" checkbox in the gallery images like they do in the image block and other link fields. That checkbox simply adds the
code before the close bracket.
The hack for gallery links to open in a new window is to add the necessary code for it to open in a new window before the closing quotation marks, which is why you add this to the end of your URL (without closing quotes):
The first set of quotes are the closing quotes for the URL, and the original closing quotes that Squarespace provides become the closing quotes for the target="_blank".
Since Squarespace doesn't allow spaces in its URLs and gives you an error if you try to add it, you need to leave the space before target out.
Hope that helps!