Hm. Try changing line 639 from this:
if keyboard[keyName] and phase == "down" and not pressed[keyName] then
to this:
if keyboard[keyName] and phase == "up" then
That way, letters will only get passed into the text field when you lift your finger off the key. In my own testing, I was able to type relatively easily when they got dispatched on the “down” phase, but that phase does repeat itself if you leave your finger down, so it could be that your system repeats faster than mine, or it could just come down to a matter of preference. At any rate, that should eliminate the duplicate entries.
Thanks.