What you can do is something like this:
Implement a C++ function with the following logic:
- Get the desired funcdef signature from the output argument of variable type
- Determine the address of the matching C++ function
- Register the C++ function with the script engine
- Get the asIScriptFunction pointer for the newly registered C++ function
- Return the asIScriptFunction in the output argument
The most difficult part will be making sure the C++ function actually have the matching signature. Because if the signature is not matching and the script calls the function, you'll most like end up crashing the application due to stack corruption or memory invasions.
If you wish to register C++ functions dynamically like this, then I suggest you look into how to dynamically determine signatures of C++ functions. I've never done this myself, so I cannot give you much help in that direction, but perhaps it would be possible if the C++ function is accompanied with something like IDL that can be read at run time. Or perhaps you could look for some way of demangling the C++ symbols (though this is compiler specific).