For 1), unfortunately, it's a problem with your plugin which clearly has not been designed to run non-interactively. Unless the plugin has an option to truly run non-interactively you'll struggle to bypass that input window. It is theoretically possible to use matlab to simulate a click on a button by delegating to the OS but the method will vary from OS to OS and depending on how that button is rendered may involve a lot of code.
For 2), you can use matlab to rename the file before calling getResultsTable:
Another option would be to rewrite whatever that plugin does in matlab.