So I would try to take that script out of each of the the actions and put it at the bottom of the watcher right after the list of actions then it should be available for both the actions, which I think would be a better approach.
See how we did it here
Also it look like you put the transform in the wrong place in the email it should have gone right after this line I think
"email_administrator": {
<! --- Here
That said I think doing what I said above (extract and make common) is a better approach in fact I am not even sure if you can transform the payload more than once.