Actually there is no need to add the while loops you mention, because the swim_mode() function and the part that I referred to as "the rest of the PlBiped01 action code" each set up their own threads and while loops. If you look at the template scripts PlBiped01.wdl and move.wdl and movement.wdl you can see the two actions yourself (swim_mode and PlBiped01).