The goto & halt commands are not needed. Also use /join instead of /j.
Your on join & on part commands should be like this
on !*:JOIN:%spy: msg %spy2 $time 3Joins: $nick %spy
on *:PART:%spy: {
If ($nick == $me) {
set %kspy off
msg $chan Leaving $chan Turning Off System
}
else msg %spy2 $time 3Parts: $nick $chan
}