These strategies are applicable to organized games. Public games are too disorganized. This general strategy works on all 2Fort variant maps. (2Fort4, 2Fort4r, 2Fort5, 2Fort5r).
The medic is best placed in the basement, between flaghall and spiral entrances, or in the ramproom. The medic's defensive job is to support the soldiers, engineers, etc. Pick up and "bring" some rockets to your defensive soldiers. If you want to distribute to many soldiers, use the dropammo command. If you need to resupply just one soldier, the discard command will work.
If a medic is defending the basement, alongside an engineer, your main objective is to save the gun. If the gun is doing really well, and is blocking intruders from taking your flag, then the incoming enemy's first objective is to take out the gun. Usually, they will send a rocket or two your way and then head on towards taking out the gun. At the time you even see the enemy, you should be priming a grenade. You should AT ALL COSTS defend that gun. The engineer will be trying to help you, but if that gun goes down, the flag will most probably be moved to the spirals.
If the flag is taken after the gun has been destroyed, (it goes without saying), follow it. Once your team has a few guys on it, (and you should heal them up), let the engineer build a sentry gun in the flagroom again. This will prevent a double flag cap where the defense gets spread out so thin that once a flag is capped, when it respawns, the flag is moved outta the spirals...Having a permanent basement piper greatly helps defense, since it usually takes out the lead in the incoming enemy offense.
In the ramproom, as I said before, heal concussions, heal teammates, and help distribute supplies. (The engineer should also help armor up the defense). If you are to work the ramproom, be prepared to be concussed. But let the ramproom defense know that if they are concussed, try to get in a corner. Usually, putting your back to a corner lets you at least fire accurate shots, although you cannot move around. Since your patient is in a corner, even if concussed, you should be able to go in his general direction. (Via normal movement, or stumbling drunkely along the walls).
Many of the medic's offense duties usually are the same for that of a defense squad. But depending on the squad, your roles might change a little bit. If your squad consists of light classes, your role is to take out sentries, concuss the defense, and take out demos. If you cannot take out demos, then at least (when the squad is coming like VERY soon), run over the pipes and take it for the team. Although "sacrifice pipe trap" doesn't show in the speedstats, your teammates will thank you for it.
If your squad consists of heavy classes, such as demos, soldiers, or pyros, you are the secondary class. You are to aid them by healing. Although you can toss a few grens here and there. =] You are the one that will get the flag if you make it to the flagroom.
If the defense begins to double up on one side of the map, usually at a bottleneck, you have two options. Try to group up your offense at another point of the map that simply bypasses that particular bottleneck. For example, if the defense goes 3 snipers and they are all Kaizen, its much better to go through the water. But, having three snipers tends to thin out the defense. So, go through the water and don't be a candidate for a third eye. Another example is if the defense goes heavy defense on the spirals. If this happens, just go through the elevator. This is a simple concept, but many of us, in the heat of the battle, seem to turn into lemmings and follow one another into certain doom.