This "if (ismod) {" is nonsense and will always return true. Couple that with not using the "n" switch with $read and $readini and this script is trivially exploitable; anybody could take complete control of your computer.
The !repeat text event will never be hit because it's captured by the first !* event.
I'm guessing the second event uses # as a prefix because whoever wrote it couldn't figure out how to prefix that event with ! and not interfere with the previous event.
This script allows you to add commands that can never be accessed, only commands beginning with ! can be accessed but any text will be written to file.
Using the channel concatenated with the command itself as the ini topic and a static "text" string as the item (instead of using the channel as the topic and command as the item) also seems like bad form.
There's a misplaced } on line 35.
You do not need to prepend commands with / in a script.