There seems to be a bug on the web UI text editors (at least scripts/marketplace), where when you first save a script (typed directly, not copied) line breaks duplicate. If you edit it again, remove the duplication and save it, it works fine.
I'm on Windows, but I didn't have the chance to try from other OS. Maybe something related to CRLF?