timer question

Hi !
I'm trying to get an action to be delayed and all of the examples I found were using the millis() to toggle true or false statement continuously so I'm not sure how to make it work for my problem..
basically I have a button that would execute "action A" when when pressed. when it's complete I'd like the program to wait 30 seconds before letting the user execute "action A". In the meantime when the button is pressed I'd like the code to execute an "action B" while waiting...
my code would look like that.. any help please ?

int buttonState = 0;
int progState = 1; //1 = good to go //0 = not ready
long previousMillis = 0;
long interval = 30000;
const int buttonPin = 2;

void setup (){
pinMode(buttonPin, INPUT);
}

void loop(){
buttonState = digitalRead(buttonPin);

if (buttonState == HIGH && progState == 1) {
progState==0;

/////////pseudo code////////
action "A"
wait 30 seconds
if button is pressed during that time = action "B"
progState==1;

}

Take a look at my thread: Arduino Forum. There is a bit of a fault there, but I think that you can implement the function into your code. Also, look at the Blink Without Delay example. They both use millis().

Try a state machine:

enum {WAITING_FOR_BUTTON_PRESS, IN_30_SECOND_INTERVAL} state = WAITING_FOR_BTTON_PRESS;

unsigned long TimerStart;

const int buttonPin = 2;

void setup (){
pinMode(buttonPin, INPUT); 
}

void loop()
{
switch (state)
    {
case WAITING_FOR_BUTTON_PRESS:
    if (digitalRead(buttonPin) == HIGH)
        {
        state =  IN_30_SECOND_INTERVAL;
        TimerStart = millis();
        }
    break;

case IN_30_SECOND_INTERVAL:
    if (millis() - TimerStart > 30000)
        {
        state =  WAITING_FOR_BUTTON_PRESS;
        }
    else
    if (digitalRead(buttonPin) == HIGH)
        {
        state =  WAITING_FOR_BUTTON_PRESS;
        }
    break;
    }
}

I spot a typo:

enum {WAITING_FOR_BUTTON_PRESS, IN_30_SECOND_INTERVAL} state = WAITING_FOR_BTTON_PRESS;

Should be :

enum {WAITING_FOR_BUTTON_PRESS, IN_30_SECOND_INTERVAL} state = WAITING_FOR_BUTTON_PRESS;

thanks so much for your answers!
I'll be able to do some test this afternoon and make sure to keep you posted!
cheeers