to do a thing like that, I'm afraid you'd have to create an addon-scroll... so yer EVENT code should prolly be morelike this:
INIT="_this select 0 exec {\myAddon\MyScroll.sqs}";
and in that script you need some PRE-DEFINED units:
a looped check like:
_MyAddon = _this select 0
#loop
_MyMoron= nearestObject [_MyAddon, "SoldierWLAW"]
...and then you'd have to add some if/then stuff:
get the point?! if door is open AND nearestObject is a _MyMoron, THEN .... etc.
but the real problem is (I fear) that you cannot pick out unspecified units in addon scrolls, so ya might need to do it from within the mission, using a pre-defined unitName :-\ :hmm: