Need help with delay function

You will need to remove all of the delay()s from your sketch in order to do what you want because during a delay() nothing else can happen

Your code appears to consist of 3 stages or states, each with a different delay period. This could be implemented as a state machine that used millis() to provide non blocking timing. This would allow the input to be read frequently without waiting for the sound/noise/etc to time out

See Using millis() for timing. A beginners guide, Several things at the same time and the BlinkWithoutDelay example in the IDE for examples of how to use millis() for timing

What is your programming experience ?