I think the problem is the 30 sec pause itself. You need to split it up into small chunks. For example 300 x 10 ms each. This will allow the interrupt to take place every 10 ms if so needed. With the pause 3000 command the processor is can't do anything for 30 seconds because it's stuck in a do nothing loop and won't see the interrupt until the 30 seconds has elapsed.