From ZDoom Wiki
A_KeenDie [(int tag)]
Checks whether all actors of the calling actor's type are dead and if so opens all doors with the tag 666.
If tag is specified, it will be used in place of 666.
This example is taken from Doom's Commander Keen decoration.
Death: KEEN AB 6 KEEN C 6 A_Scream KEEN DEFGH 6 KEEN I 6 A_NoBlocking KEEN J 6 KEEN K 6 A_KeenDie KEEN L -1 Stop