No, your code is not good!
You cannot have an interactive while loop inside an event structure that locks the panel until the event completes. You can use the single outer loop for all "looping".
Changing S0..S1 while the inner loop is running has of course no effect because these controls are only read right after program start an after an event has completed.
Your outer wait has absolutely no purpose because the outer loop iteration is entirely determined by the event structure.
You really need to rearchitect everything for proper dataflow. Explain exactly how you want to do things using the UI, (e.g. how do you plan to "select channels one after another"? Which controls are these? What should happen?)