Script for Draft Transfer

The draft transfer function is customized on this client's system to open a second window to choose the payment manually 

Its great enhancement but it causing issues when using it as recurring task as the function is not working and stuck into loop  

Is it possible to use script to run the function to pass by the criteria screens