To be able to use the mask everywhere it would be best to implement the lines in the setuplevel.fpi.
A more easy way is to make the Hurt Zone as large as your room is and use a combination of your gasmask script and the plrhurtinzone.fpi
Could look like this (not tested but should work):
;Artificial Intelligence Script
;Gas Mask script
;Header
desc = gas mask script for use as Main script of a Hurt Zone
;Triggers
:state=0:localvar=1
:state=0:setvar=0
:state=0:hudreset,hudx=50,hudy=50,hudsizex=1680,hudsizey=1050,hudimagefine=gamecore\huds\gasmask.png,hudname=mask,hudhide=1,hudmake=display,state=1
:state=1,scancodekeypressed=33:hudshow=mask,state=2,setvar=1
:state=2,scancodekeypressed=0:state=3
:state=3,scancodekeypressed=33:hudunshow=mask,state=4,setvar=0
:state=4,scancodekeypressed=0:state=1
:plrwithinzone=1,varequal=0:plraddhealth=-1
:plrwithinzone=0,varequal=1:hudunshow=mask,state=0
;End of Script
You could use a global variable too.
Just set it to 1 when plr is using the mask and set it to 0 when he doesnt.
The gasmask script:
;Artificial Intelligence Script
;Gas Mask script
;Header
desc = gas mask script with global variable
;Triggers
:state=0:globalvar=77
:state=0:setvar=0
:state=0:hudreset,hudx=50,hudy=50,hudsizex=1680,hudsizey=1050,hudimagefine=gamecore\huds\gasmask.png,hudname=mask,hudhide=1,hudmake=display,state=1
:state=1,scancodekeypressed=33:hudshow=mask,state=2,setvar=1
:state=2,scancodekeypressed=0:state=3
:state=3,scancodekeypressed=33:hudunshow=mask,state=4,setvar=0
:state=4,scancodekeypressed=0:state=1
;End of Script
The new plrhurtinzone script:
;Artificial Intelligence Script
;Hurt Zone script
;Header
desc = plr gets hurt in zone when globalvar#77 == 0
;Triggers
:state=0:globalvar=77,state=1
:state=1,plrwithinzone=1,varequal=0:plraddhealth=-1
;End of Script