I don't think that there is really a way to truly prevent stomps without having an admin take control of the team balance. The reason why is because the primary thing that the defense needs to survive is a balance of good players in the right classes. Assuming you have a team of 10 people, you really need to have at least one engineer good enough to place his stuff correctly (two is better), a good heavy, a good medic, and a good pyro. You also can't afford to get too many of some classes such as snipers and spies because those people tend to be less effective when there are too many of them. The rest of the team just needs to use classes appropriate to their skills and/or the situation.
Unfortunately, there is no way that you can really enforce this. Probably the best thing we can do to encourage a better team balance would be to lower all class limits to two (maybe except for engineers), but that still doesn't prevent your 10 person team from being 2 snipers, 2 spies, 2 scouts, 2 medics, a soldier, and a demoman. It also obviously won't fix skill imbalances. That said, it still might be a worthwhile experiment to lower most class limits to 2 for a while, since most of the time you are really hurting your team if you are on defense and playing as a third member of the same class. I know that having class limits of 2 might prevent some people from playing the classes that they really like, but it is also preventing people from hurting the gaming experience of others by becoming the third spy and making the entire rest of the team have a worse time of it. To quote Spock: "The good of the many outweighs the good of the few, or the one."
SHORT VERSION: Let's try lowering the class limits to 2 per class (with possible exception of engineer) and see if that helps.