In the cycle.sc file, go to (class Motion of Obj and you should find DirLoop there sitting all by itself. Remove that, and add something like this:
(if ((== (send client:heading) 0) or (== (send client:heading) 360))
(send client:loop(3))
)
(if (== (send client:heading) 90)
(send client:loop(0))
)
(if (== (send client:heading) 180)
(send client:loop(2))
)
(if (== (send client:heading) 270)
(send client:loop(1))
)
(if (== (send client:heading) 135)
(send client:loop(4))
)
(if (== (send client:heading) 225)
(send client:loop(5))
)
(if (== (send client:heading) 45)
(send client:loop(6))
)
(if (== (send client:heading) 315)
(send client:loop(7))
)
What this does, is takes the heading property from the referred object and test it against the 8 angles, 45, 90, 135,180, 225, 270, 315, and 360. 0 and 360 will both equal up. I used a view from Codename: Iceman to test this out, so use your own loop numbers, if they're different.
P.S. Excuse me if this has already been covered.