This appears to be related to highlighting. It is also influenced by the amount of code in the script and by the amount of comment text. However, commenting out all preceding code, or turning it all into a very long string, can make the problem vanish. The affected scripts compile and run without unexpected errors, but it becomes difficult to edit certain lines within the editor:
Steps to reproduce: In an SLua Enabled Sim, rez a new prim. Create a new script, open it, and replace the contents with the attached script.
Note that "LLEvents" in line 14 is highlighted in green.
Attempt to select the line.
Observe that only the word "function" is highlighted.
Copy the line and paste at the bottom of the script.
Observe that the whole line is pasted.
Place the cursor at the left edge of the line and move right one character at a time with the arrow keys.
Observe that the characters "s.touch_e" are skipped as a group.
Attempt to select or erase "_end".
Depending on your method, various failures will occur.
Press End to move to the end of the line.
Observe that the visible cursor is well past the end of the line, but that backspace deletes the last character.
Note that when the line no longer represents a proper event that the line becomes normally editable.
Comment out line 12.
Observe that "LLEvents" becomes blue and the line is normally editable.
Reenable line 12 and delete line 13.
Observe the same.
So far, I have only observed this with LLEvents.touch... All 3 are affected.
In-Editor WORKAROUND: When editing an affected line, change the first keyword by adding an extra character at the beginning, such as making "LLEvents" into "xLLEvents". Edit the line as needed, then remove the extra character.