Auto-translated
The best advice for anyone facing a similar problem is to forget about the Edit Script button altogether. Never even try to use it if you need to edit scripts. Creating a file for scripts is possible, but editing them using that button is not! So, what should you do? Here's how I work: Find the map files (they might be in a hidden folder). There, you'll find the MapScript.lua file (the extension might not be displayed if you haven't enabled the display of extensions in your system settings). Next, open the map in the map editor, and open (if you haven't already) the MapScript.lua file, and modify it as you like (within reasonable limits, of course). After you're finished adding/changing things, save the file, and simply restart the map, i.e., click "Open Map" and select the same map. It's best not to touch anything on the map itself during this process; otherwise, it might happen that the script will be saved along with the changes on the map, meaning all the edits in the file will be lost. However, I don't guarantee that this will definitely happen, so feel free to experiment