During WW2, five other u-boats were captured by the USN and the RN besides U505: U110 (later lost), U570 (later HMS Graph), U559 (later lost), U744 (later lost), and U1024 (also lost.) The boats lost all sank under tow. The U110, U505, and U744 all yielded code books, and the U505 brought the only Atlantic Fleet Medal of Honor (for the war) to capturing officer Albert David. It's fair to say it was a common thought.
Gallery had, if not a plan, at least a concept for capturing a u-boat. The U570, having essentially surrendered to a RAF bomber and a tug after being damaged, led Gallery to consider if a u-boat might surrender to a PBY. And his earlier failure to capture U515 was the genesis of the concept, and the U505 became the opportunity. Gallery instructed his forces not to sink the U505 unless it tried to submerge.
As an aside, Gallery got in trouble with King for bringing back USS Nemo, as the U505 became. The only reason Gallery was where he was was because of Ultra, and the knowledge of a captured u-boat could certainly infer Ultra's compromise.
Primary Source: U-505: The Final Journey, published by the Museum of Science and Technology, Chicago.
According to his report on the capture of U-505, Captain Gallery sailed Task Group 22.3 "with the avowed intention of capturing an enemy submarine."
PART ONE PRELIMINARY EVENTS
Task Group 22.3 sailed from Norfolk on this cruise with the avowed intention of capturing an enemy submarine. The action in which U-515 was sunk on our previous cruise had convinced us that when a sub surfaces during an attack it is highly probable that he has no intention of fighting and his main objective is to save his hide. We therefore determined, in case opportunity arose in this cruise, to assist and expedite the evacuation of the U-boat by concentrating anti-personnel weapons on it, to hold back with weapons that could sink the sub, and to attempt to board it as soon as possible.
This was discussed at the departure conference of all C.O.s before sailing, and all ships were ordered to draw up plans for capture and to organize boarding parties. When we thought we were going to get a crack at a sub near Bermuda on the way out, a signal was sent reminding all hands that our objective was to capture (Encl. H-1). The Plan of the Day for June 4 on the Guadalcanal (which was printed and distributed on the evening before the U-505 was captured) contains the final list of the crew drawn up on the Guadalcanal to man and operate a captured sub: (Encl. H-2).