thats quite unneccessary you only have to escape the | , also the %z is evaluated twice. Once when you send it to the timer and once when the timer is executed.
try this:
alias test {
var %x = $!me
/timer 0 10 if ($me == $me) { echo -a %x $(|,) echo -a yay! }
}
cleanest thing to do is put the timeroff declaration in the afk2 alias.