Switch-case loop problem?!

[code]    if( millis() - prag_tm2 > 10000)
    {
      flag_tm2 = 1;
      var = 0;
    }

So after 10 seconds, go back to state 0 and

  case 0:
      pos_tm1 = 120;
      pos_tm2 = 30;

Reset your positions, regardless of whether or not the servos have run their course? Once you hit state 0, your increments and decrements become ineffective. You should only be resetting your values until after you are sure that they are done moving. Perhaps it would be better to do that the same time you clear their flags, or better yet, add a 3rd state that will wait until both flags are cleared before resetting the position values and returning to state 0. Paying closer attention to what happens during the states and during the transitions will also help down the road. That was why I posted the previous helper functions for changing states.

switch (state)
{
  case FIRST:
    // this happens every loop, when it is in this state
    if (some condition exists)
    {
      // set the state variable to SECOND
      // this will only occur once, during the transition from FIRST to SECOND
    }
    break;
  case SECOND:
  ...
}

You also should take some steps to remove redundant code. Obviously, you are going to be expanding on this, so having additional lines of code and variables is going to make it more difficult to debug. Hint: You don't need two prag_tmX variables and your check for flag and check for interval can be done on a single line.[/code]