I re-worked the code, and found
the problem is in the CHR$ variable,
so heres my code, remember that everything here is in TIMER 20, along with other irrelevant code, but I'm only showing you the relevant code:
LET
x = x value on the grid
y = y value on the grid
xco = x-coordinate (a smaller x value which is easier to understand
yco = y-coordinate as the latter
prex = x-value before the last keydown
prey = y-value before the last keydown
precos = prex, and prey coordinates in the form: (prex,prey)
aftcos = xco, and yco in the same form as above
TIMER 20
 xco = x - 5
 xco = xco / 21
 xco$ = CHR$ "xco"
 prexco = prex - 5
 prexco = prexco / 21
 prexco$ = CHR$ "prexco"
 yco = y - 5
 yco = yco / 21
 yco$ = CHR$ "yco"
 preyco = prey - 5
 preyco = preyco / 21
 preyco$ = CHR$ "preyco"
 precos$ = "("
 precos$ = precos$ + "$prexco$$"
 precos$ = precos$ + ","
 precos$ = precos$ + "$preyco$$"
 precos$ = precos$ + ")"
 aftcos$ = "("
 aftcos$ = aftcos$ + "$xco$$"
 aftcos$ = aftcos$ + ","
 aftcos$ = aftcos$ + "$yco$$"
 aftcos$ = aftcos$ + ")"
 string$ = string$ + $precos$$
 IF string$ CONTAINS $aftcos$$ THEN
  ALERT oh dear you died
  ALERT $string$$
 END IF
END TIMER