Control different functions using the same push button. ARM 7
It's not going to work without some basic debouncing which if you don't want to use interrupts means a basic wait function unless you debounce in hardware.

The intended functionality of your code seems to be to call the set LED functions constantly while the button is pressed, going by your description there is no need to do this, you can call them once and then wait for the button to be released. They will remain lit until a different LED setting function is called.

Finally if you are ANDing the IO register with 0x02 then the result is either 2 or 0. Rather than checking for a specific value you can use the c convention that 0 is false and all other values are true, this makes the code a lot cleaner looking. Moving that into a function makes it even nicer to read.

int SW1Pressed (void) {
  return !(IO0PIN &amp; 0x00000002) //switch connected on P0.1. Low when pressed.
}

....

count = 0;
while (1){
  if (SW1Pressed()) {                         //when pressed
    wait_ms(100);                             // wait 100 ms
    if (SW1Pressed()) {                       // still pressed.
      if (count==0)                           // turn on correct led
        function1();
      else
        function2();

      if (++count == 2)                       // update count
        count = 0;

       while(SW1Pressed())                  // do nothing until the button is released
         ;
    }    
  }
}