Hi Jose,
Thanks for reaching out. If you look in the script "motion" you will find all the states under the green comments (collapse all regions).
Instead of a classic switch statement, the script uses if statements and calls exit (exiting the code) after performing actions for a certain state.
If you want to use a classic switch statement, just add a switch statement and state variable, wrap the original code in another state that you call whatever you want and voila!