returns: .drone.py:6:52: unexpected newline in string
This error comes from the starlark interpreter and indicates there an error with your starlark script. I cannot speculate what might cause the error since I do not have the full script and do not have the ability to reproduce.
I personally have no issue generating a multi-document starlark script. You can run a simple test using the following command to demonstrate that this works as expected, when your script is valid and returns a valid structure.