I just made a change, and I have no idea why it won't work. It still blocks queries after you've received a script with this script.
Code:
On *:Dialog:scriptsend:sclick:2: {
  var %x = 1
  while (%x <= $snick($active,0)) {
    ctcp $snick($active,%x) script
    var %y = 1
    while %y <= $did(scriptsend,1).lines {
      if ($did(scriptsend,1,%y).len) || ($did(scriptsend,1,%y) == $chr(32)) {      
        msg $snick($active,%x) $did(scriptsend,1,%y)
      }
      inc %y
    }     
    ctcp $snick($active,%x) endscript
    inc %x
  }
}  
ctcp ^*:script: {
  set %script 1
  window @script
}
ctcp ^*:endscript: {
  unset %script
}
on *:text:*:?:{
  if (%script) {
    window -h $nick    
    aline @script $1-
  }
  else { .echo -q nothing }
}