Well it happens often to me that when i am losing a battle (when a few AI players team up against me), in the end I have only a few planets left. In this case, I don't have anything to spend my money on (except starbases of course) so I will have a huge amount of credits and resources left. The AI usually ammasses it's fleet in a gravity well linked to one of my own wells. So if I would be willing to build a titan, I would have to sacriface about all the ships I have left by sending them into a hostile well (based on your idea). Besides that, sending my fleet away from a planet will leave that planet open for an enemy assault, which would be more of a waste than a gain if I do end up with a finished titan in the enemy well.
When I am in that position (note that I'm usually the TEC) I build a starbase in the gravity well the enemy is about to attack and immediately give it both levels of Last Resort. I'll have another constructor on the opposite side of the same well. When the enemy fleet attacks me, boom. A small force can mop up the unsupported caps and other survivors, and another starbase will already be on the way. I've been able to keep this up for hours against two Advent and a Vasari computer in DS while attacking on another front.
On topic though, if you have as many resources as you say, then all you would have to do would be to build three fully upgraded military starbases (2 weapons and either 2 or three hull and SC depending on the race's abilities) to form a perimeter around your titan being constructed (we can have four SBs around a star remember.) Depending on how the AI prioritizes titan yards, torpedo cruisers will either attack the starbases first, wasting their time, or attck the shipyard, bringing them withing easy range of your starbases. You would only need to put ships nearby if you wanted an extra line of defense or if (heaven forbid) the enemy brings a titan, in which case we can assume that unless you scare it away, the game is over anyway