A little tricky since when an "event while" is actually evaluated is not really predictable. For a safe, working example, see the "walk test" world at the end of the thread
http://www.alice.org/community/showt...highlight=walk . Note also the "move at rate" command - that will allow you to change the speed easily.
For more details on the programming issues, I believe Dick Baldwin's tutorials have some information. There is a lot of information also scattered through the forum, but it is a bit difficult to find. (Anyone have any good suggestions on keywords for searching?)