As Cobra said, mIRCskript isn't the best language to code such things, i've started coding IRCd once, but i got tired of this.
There was some bugs i can't fix, like the "extra spaces got removed" problem
Go to wIRCds net
and download some IRCd for windows.
I'd suggest Unreal (tons of features, some useless), or Dreamforge - if you want a "normal" IRCd