[IGN-16691]Gateway Event Script Compile Error

I'm facing the same error after upgrading to 8.3.7

I've noticed that the issue is on the first indent/keyword. If you don't want to move your logic into libraries, another workaround is by adding triple-quoted string on first line.

""""""


and it let you save. I hope it gets fixed soon.