Hello & welcome, gocsal !
when I try to run a script the machine freezes and will not shoot a photo. In the left upper corner the message "uBasic: 2 Unk stmt" appears.
The script you've loaded is not a valid script, at least line 2 is incorrect; probably the file is not a plain text file.
The camera does not freze - just press the shutter to stop/exit the script, then load a valid uBasic or Lua script.
Read also
here for CHDK scripting, for Lua scripts you'll find more informations
here.
CHDK scripts are- plain text files, no MS Word, Wordpad or similar documents; use a simple text editor, e.g. Notepad or Notepad++ on MS Windows.
- save the text files with ANSI encoding (NOT unicode !)
- for uBasic scripts, use .bas as filename extension, for Lua use .lua