It depends on what Gryffindor and/or Ragnuk the First meant by "strengthens", and (more importantly) how was that "explained" to the Sword and also whether Gryffindor was actually involved in making it or not.
Since bravery is of main importance of Gryffindor, and becoming more powerful at the cost of risking the life of your friends could quite be viewed as cowardism, and given that Gryffindor was a legendary wizard and that the sword is a masterpiece of goblins, the sword may have a very subtle understanding of strengthening.
Even if Gryffindor wasn't involved in making it, he still may have choosed a sword with the right ability.
Arguably, the existence of very refined magic of this kind may also already be present in Gryffindor's belongings, given that "only a true Gryffindor" could pull it out of the Hat, since it should be able to sort out not only "who is friend and who is not", but it also have to weigh the attitude, skills and "fitness" of the person. The Hat is of course already able to sort people into Houses based on very personal qualities!
Well, even if not present from the very begninning, it would definietly strengthen the Sword if it would imbue such abilities, telling friends and foes apart, and it doesn't have to "go far" for it, since the ability is already present at its "home" (the Hat).
The sword also repells dirt and staining substances, and this makes it something that could be called noble.
I think this is important as the Sword must have the "intention" of being noble, and thus it must stay away from becoming something like a furious angel that risks, and is potentially able to kill anyone by accident, "for the greater good" of being an all-mighty weapon.
Also, even if all these are wrong and the Sword is actually becoming an increasingly impractical item over the ages, the Sorting Hat could still function as a safe-guard mechanism that would only give the Sword to someone who is actually worth, including that he is able to be careful enough not to harm friends accidentally.
Note: by friends I mean people who are up to the Sword's (Gryffindor's?) standards, I call them like this for the sake of simplicity.
EDIT The motivation for writing this answer came from the excellent question by Pureferret in the comments