Does the word Stat or Routine Study exist in the rows?

You could add an additional IF condition

{=AVERAGE(IF(range of rows with Stat and Routine="Stat",IF((E5:E454<8/24)+(E5:E454>20/24),Q5:Q454)))}

or

{=AVERAGE(IF(range of rows with Stat and Routine="Routine Study",IF((E5:E454<8/24)+(E5:E454>20/24),Q5:Q454)))}