This posting is older than 6 months and can contain outdated information.
I had tried your suggestion:
tell application "System Events" to keystroke return
but it doesn't actually trigger the ok button. I had also tried keystroke enter but that doesn't work either.
Weird.
And, because it is the login box, I haven't figured out how to use the Apple UI Utility to figure out what the button to trigger it via UI scripting.
Anyway, I am able to use QuicKeys so I'm happy.
Thanks for the info about the known bug.