The other day, a couple of demos were doing the "Ka-Boom" taunt repeatedly inside their spawn. Would this be a rule infringement?
What about if someone kept laughing at a wall?
There are many behaviors that can annoy others. A heavy next to a resupply cabinet firing continuously, a scout throwing the ball right next to the wall to pick it up fast, or an engineer that keeps shooting his pistol.
From your wording, it appears you were perhaps angry at the particular players, but not just for taunting. Why are you deciding on someone else's intentions? This looks like an overreaction, such a rule is an absolutely disproportionate measure. TF2 is known for its silly moments, and those silly moments often sprout from what you're asking to ban.
I hope nothing of the sort is implemented as a rule.