I have been playing around with this a bit for the last two days and it looks like there are two versions of cscript. If I run cscript from path or from system32 I was having your issue, even though I'm using 32 bit Python as well.
Finally found that there's a 64 bit version in .\syswow64 so when using that it started working.
Additionally, I was getting a traceback error using exit(0); or any combination, but when switching to SystemExit(0) it worked with cscript with no issue.
That's not the end of my rabbit hole, but hopefully it helps you resolve this issue.
My test -
C:\Windows\system32>c:\Windows\SysWOW64\cscript.exe /e:python c:\python34\Scripts\test.py
Many thanks for your reply. I tried your method and lo and behold it worked. The next step I guess would be to make it work through the SAM component, which is still giving me the same error, I guess because it is defaulting to the 32bit version.
How did you make the SAM component/Solarwinds default to the 64bit version?
Really appreciate your assistance so far!