That looks like a DPH script. In fact, it looks like the default request-side DPH that gets added as a template whenever a request DPH is added to a virtual service, but without the /* */ comment around it. Why are you trying to run it as a script, rather than as a DPH? In fact, it only contains samples of things you can do - why are you trying to run the whole uncommented script at all?