Your !write syntax is correct and does work in testing so i assume theres 1 or 2 possibilities...
First of all, does vcmp.cmdcheck return pass or fail? if it returns fail then this would be why its not working
Second thing would be what operating system are you using and what version of mirc?
Under vista with mirc 6.3, doing !write blah.something 1 2 will write a file call blah.something to C:\Users\<Username>\AppData\Roaming\mIRC. Have you checked there for the file?
If you want it to be in the script directory, use !write $qt($scriptdirblah.something) 1 2
Hope this helps