Extending a MIB at runtime would defeat the purpose of having a MIB. The MIB is supposed to tell the manager what variables are available, and if the variable set changes dynamically, the MIB does not provide this information to the manager.
I'm sure it could be solved somehow, if the manager could regularly fetch the MIB file by FTP when needed, and was able to dynamically adapt to the MIB contents, but I've not seen an NMS capable of that. Even it is possible, I'd strongly advise against such a breach of convention. There are RFCs about how to make changes to a MIB module, and you'd be violating them for sure.
I think the best you could do is have the list of subroutines in a Table (which the Agent is allowed to dynamically change during runtime). Then, make a scalar read/write variable "runSubroutine" where the Manager could set the index value of the subroutine it wants to run. Put arguments and return values in other variables. The Manager would do an SNMP walk of the subroutines table, find the index of the one it wants to run, and then send an SNMP set command with the arguments and subroutine index.
In the end, that might work, but please for the love of Knuth, consider using a real RPC protocol instead of trying to squeeze such capabilities into SNMP.