A team should always have one tank defending the square containing it's team base. Otherwise it is too easy for the opponents to spawn and steal the flag. So if my base is undefended, I'll go and defend. This is especially important right after my team has stolen the enemy flag, because the rest of my team-mates will probably charge the enemy base leaving my base as an easy target for spawners.
If the enemy is not attacking then it is wasteful to defend a base with more than one tank, so if I can see another tank defending, then I typically leave the base and attack as fast as possible. However if the other defending tank is a newbie or otherwise unstrustworthy, then I try to make him attack, so that I can stay back and defend. Sometimes it helps to drive very close to my base. That causes the other defender to give up on me and attack on hos own.
I think that it is better to charge than to camp outside the square that contains the enemy base. You don't lose anything by charging because if it fails then you can just spawn and charge again.
The problem if you camp outside the square with the enemy base, then the enemies will keep spawning close to their living teammates. In other words the enemies will spawn close to the place where they die, so you never empty the square from enemies. I think that the only way to remove the defending enemies is to drive into the square so they start spawning somewhere else.
In general I think that it is impossible to keep all the tanks of a team away from the map for a long period of time. The best you can do is to force them to spawn in one of the two corners that do not contain any bases. If they spawn in such a corner then they will be too far away from the flags to make a difference to the flag game.
I often try to attack the enemy base along the far edge wall. It takes a little extra time to drive all the way to the edge wall, but once I am there it becomes easier to attack. One benefit is that the enemies may not discover me, so sometimes I can get close to the enemy base before I am discovered. Secondly I can shoot some defenders in the back because they point in an other direction. (Or my team-mates can shoot them as they start pointing towards me)
I think that I have to take chances to steal the enemy flag, so if I can see that my teammates have a good chance of killing the defenders, then I may stop shooting and start driving directly towards the base even though some defenders are still alive. This way I can steal the enemy flag so early that the rest of the enemy team has no time to arrive and defend. (Of course I only do this if I am closer to the enemy flag than any of my team-mates).
Sometimes an enemy will hide behind a box. In this situation it helps to attack together with a teammate, so that you can flank him.
Returning with enemy flag
Some of the great players are able to drive through the center with an enemy flag, but that is very difficult to do for a mediocre player like me. One problem is that if I lose the enemy flag somewhere in the middle of the map, then it typically gets stuck i a major battle for a very long period of time. Meanwhile the enemy team has time to pick up our flag and score a win.
Instead I always try to take a route that takes me past one of the two "buildings". That makes it easy for my team-mates to defend me and easier for them to pick up the flag if I lose it. I try not to change direction too often, because my team-mates needs to be able to predict where I am going so they can clear the way.
Finally I try to move pretty fast when I have the enemy flag. It is often better to take a chance and move fast than it is to take cover and wait for my teammates to help me out.
One exception is that sometimes the square containing my base is full of 3-4 enemies when I arrive. In this situation I have no chance to get through to my base without help. And I if I die in the middle of a crowd of enemies than it is too easy for them to pick up their flag and save it. When this happens, I often try to camp close to the edge wall just outside the square that contains my base. That causes the enemies in the square to turn around and attack me to save their flag, and then my teammates has a chance to shoot them in the back.
Saving your team flag
If an enemy has stolen my flag, then I try to stop him as fast as possible. Sometimes this requires me to drive away from an enemy that is firing at me. Because I have no time to stop and shoot back. This can be frustrating, but the best way to help my team is to go and save my flag. Sometimes the enemy flag carrier is defended by a group of teammates. When this happens I try to fire at flag carrier rather than the teammates. The problem is that if the flag carrier gets away it doesn't help to kill his teammates, but if I kill the flag carrier then it takes time for the teammates to pick up the our flag.
Sometimes it makes sense to steal the enemy flag even though our own flag has been stolen. Because I still have a chance to outrace the enemy flag carrier, and score a win before the enemy does. But in many cases I am so far behind in the race that I can never win. When this happens it is better to ignore the enemy flag and try to stop the enemy flag carrier. The problem is that if I stand close to the enemy base then I may be the only tank in my team that has a chance to stop the enemy flag carrier.