One problem I see with this is that you're formatting/copying all the player's names while checking. An easier way to do this would be to remove all characters which allow name stealing (space and % at the start/end of names) by using a custom "TrimString", then compare the names to unmodified player names instead. If this is the case it shouldn't have to format both the player's name and the other players' names to check against for every player.
Otherwise, this is an awesome idea
It should stop 99% of hackers in TF2 (Most of them use the same 'hack')