I've just messed around with the code a bit, and it looks like the problem is at the "UNTIL NOT s," not sure why it reports it at the REPEAT. Anyways, the problem is you can't have "NOT s" (or just "s" in an expression for that matter). You need to find some other way to tell when you've cycled through all of the 'snakes.'
EDIT: If your trying to cycle through the snakes backwards, I'd make a function to count how many snakes there are (CountSnakes()), then know to exit the repeat...until loop once you have iterated through the desired number of times.
EDIT: If your trying to cycle through the snakes backwards, I'd make a function to count how many snakes there are (CountSnakes()), then know to exit the repeat...until loop once you have iterated through the desired number of times.