<…>
The code is not written in it’s most efficient form. With your Activity, 1106, the code will set the value of the variable waittime for times, each replacing the prior value, and ending up with a value of 4 (seconds).
The code would be more efficient (although it barely makes a dent really) by using a case structure or and if then else type structure, which would set the variable to a given value only once with your Activity.