I would write the exit code you want ... say
Write-Host -NoNewLine "Code 1"
then you can look at the Output property of the script and then use TEO's conditionals to spin off of that.
You should look to upgrade TEO as well.. we are on version 2.3 now as the most recent release with 2.3.1 due out shortly.
If you need more help directly with this you can open a TAC case and support can give a quick look, but most likely custom stuff would be directed to AS after TAC takes a quick look.
CPO/CIAC Support Lead
Principal Engineer, CX