@Haugor,
I believe that msgbox needs that the kobo launcher is running. Therefore, I would
- run the script from kobolauncher in order to see whether it is working on your device. If there is a problem the messages shown by msgbox will help you solve it. If everything works as expected, then
- remove (or comment out) the lines of the script that call msgbox
- run the script from KSM
If you like you can later rewrite the script to display error messages via kbmessage.