I believe you've misunderstood the normativeness of the "sub" and "byref" keywords. If you've taken them from VB, you've chosen two completely unrelated terms to describe this value. They have little, if not nothing to do with static variables or scope. I don't see how this would "allow greater ability for modular coding while not being too outlandish in expectation". Greater than what? Use hashtables for your configuration, then you'll find that the ability for modular coding is increase beyond the scope of your suggestion.
mIRC has a primitive form of subroutine: aliases. The difference is you can't specify the type (because mIRC is a weakly-typed programming language) or name of parameters or return values. I have no issue with your idea, however implementing this functionality as the inappropriately obscure keywords "sub" and "gosub" is stupid and could lead to confusion from gurus, who actually know a thing or two about programming. Perhaps your idea would be best described as a form of scope extension ... which, aside from nested functions, hasn't been done in a programming language yet, and would be a great idea. It needs one keyword. Something like "extend", not "GoSub".
As far as I know, everything in mIRC is by value (as opposed to by reference). To explain the difference it is necessary to understand how the parser passes values between functions. Using the following example I hope to explain to you what byref actually means.
alias caller {
var %text = Hello, callee. I have your coffee for you.
callee %text
echo %text
}
alias callee {
tokenize 32 Thankyou, caller. You make a great pot of coffee!
}
From the output of this piece of code, one can observe that "arguments" passed to functions are passed by value. The caller declares a variable, passes (the value of) that variable to the callee. The callee then modifies it's local version of that variable (using the only method I know of to do anything similar to this). The callee's reassignment will not affect the caller's value. %text will be the same after the call to callee, as it was before the call to callee. If the variable was passed by reference, %text's value would have changed when callee reassigned it's parameter storage space.
Now, by adding a timer to this example, I hope to explain to you why it would be difficult to implement passing by reference (ByRef!):
alias caller {
var %text = Hello, callee. I have your coffee for you.
.timerGiveCoffee 1 0 callee %text | echo %text
.timerGiveCoffee
}
alias callee {
tokenize 32 Thankyou, caller. You make a great pot of coffee!
}
From the output caused by the call to the alias timerGiveCoffee without any arguments, one could note that mIRC appears to simply substitute the value of %text into the expression "callee %text | echo %text". This leads to a difficulty in tracking the argument. The variable appears to be removed from evaluation after declaring the timer, so how is callee to know that it's input originated from a variable to begin with?