I can understand hitting yourself if you move forward into the direction the spell is cast, but not when you're moving the opposite way

EDIT: I tried to reproduce it backpeddling down a long corridor, but couldn't. Perhaps it occurs while backing away from a wall, since shooting a wall next to you damages you. I don't think this has been the case in all the situations, though. I'll come back with more info if I find any.