Doesn't it already accomplish this? The game accepts an input every n frames; if the chat has a higher occurrence of a certain key input it has a higher chance of accepting that one.
No. Now there is a chance that the key with the highest occurrence is selected, but in the method proposed the highest key would get always get selected.