Scripting: Allow struct methods to return dynamic arrays

Allows a member function of a struct to return a dynamic array, just like in a regular function declaration.

I hope I'm making a pull request to the right branch.