We don't use command based, but all while loops in any of our three main functions (Teleop, Autonomous, or Test) look like this:
Code:
while(IsOperatorControl() && IsEnabled()) {}
Code:
while(IsAutonomous() && IsEnabled()) {}
This prevents any loops going longer than they should, such as when the mode changes or the robot becoming disabled.
Hope that helps.