Room automation project

It sounds like a Finite State Machine (FSM) would do what you want.

Sounds scary but isn't. Use switch/case and have the code in a WAITING case wait until the trigger phrase is heard then switch to a RESPONDING case to wait for a command for a period. Use millis() to time the period so that code execution is not blocked. If a command is received then act on it and return to the WAITING state, similarly if the period ends.

If you are not familiar with using millis() for timing then you may find
Using millis() for timing. A beginners guide useful.