Nice spot smile
The .vbs is created at $mircdir (until another dir is specified - like in your edit), and the final $com-call obviously has to call it there.
One issue remains with your edit though: you can assume r/w rights at $mircdir, but you cannot take them for granted at $nofile($mircexe). And (side note only) you'd need to quote $+($nofile($mircexe),%id) (for the /savebuf and /remove commands, as $nofile($mircexe) may contain spaces.

I suggest the following change (based on the original snippet which savebuffs the .vbs "safely" at $mircdir):
Code:
 .comclose %id $com(%id,run,1,bstr*,$qt($mircdir $+ %id),uint,0,bool,true)
instead of the original
Code:
 .comclose %id $com(%id,run,1,bstr*,%id,uint,0,bool,true)