My priority early war is to get inside the convoys. I normally find 'em, plot 'em, join 'em. I try and take up a position in front and off to the side of the convoy, facing head on to the lead escort. Weather permitting I'll be at decks awash (between 7 -8 on the depth scale, click just below 8) and at ahead slow. I watch that lead escort like a hawk, he tends to weave about as he searches for submerged threats in front but as you're not submerged, he won't pick you up unless he rolls right over you on one of his weaves. It's a matter of timing and when there's a gap and he's heading away from you, you can afford to notch up to ahead one third to slip through unnoticed.
Now you're behind the lead escort and ahead of the merchants you can start identifying your targets. You have to be quick depending on the speed they're travelling but I try and place myself between the columns at 90 degrees to their course at peri depth (I have community units and some of them have guns onboard, even at the start of war). In my VII I try and set up so I can fire 2 torps at a ship 2 columns in front, 2 torps at the ship next to it in the first column in front and my rear torp at a ship in the column directly behind. This works well and allows you to get all your tubes emptied in one go.
As soon as they're away I turn into the direction of the convoy and start down, deep, to reload. One advantage of this is that the escorts, when things start going boom, have to navigate through the columns to get to you, which gives you a lot more time to weave about and that's if they find you at all. A lot of the time I hit flank as soon as the first torp hits (after that the other ships will be hard pushed to avoid the other torps) as this keeps me inside the convoy and matching their speed, if not going faster. I'm head on to the lead escort as he turns about and when he gets about 1000m away I go silent, 1-2 knots and 15 degrees right/left rudder (depending on where I am in the convoy, I want to stay inside it as long as possible). Once he goes over the top I'm silent running off, flank and back in the direction of the convoy.
The escort will again have trouble navigating around the ships and I may get a chance to come up to peri depth, find another large ship and if the seas allow, throw a magnetic under it from it's 180 degree position. This takes practice though as the ships will be weaving and it's a matter of timing and keeping the range as low as possible to be sure of getting a hit. At this point I'm looking around to see if the other escorts (if any) have joined the hunt. If not, I'll set up a rear torp at magnetic to waste the first destroyer that is probably coming at me from behind. This gives me a little extra time to hit some other merchants before needing to reload again, for which I go deep at flank and cut engines to check the hydrophones for my next destroyer nemesis. The outside escorts always take a while to get to you for the same reason as the first, they have to navigate through the convoy.
If they are still a way off, I'll come back up to 25m while reloading and get myself very close to the hull of a merchant, just in case I missed an escort on hydrophone I don't want to be in open water when he pounces. Normally, I can rinse and repeat until all torpedoes are spent and then go deep and silent to evade and move away, normally out the back of the convoy keeping any destroyers on my 180.
Later in the war when radar becomes a factor I follow the same route into the convoy but go deep and silent and back up to peri once the lead escort has passed, everything else follows the same procedure. Once things start getting real dicey in the later years I don't even attempt this and have to rely more and more on long shots from the side against convoys as the ASDIC is too good to get inside, but the newer torpedoes with a search pattern can wield good results if you plan out your shots well and luck is on your side. You better be running away as soon as the torps leave the tubes though as once they find you, they'll stick to you like poo on a blanket.
Ok, so it's not really a post on how to 'avoid' trouble, but it is a way of causing trouble and getting away with it.