Hi Amy,
It is very difficult to provide a solution for this without checking the actual code and data on that.
There is still a possibility to optimize the source code written in SQLScript and make it faster but that will depend on the complexity of the logic and data size etc.
We need to investigate the root cause of the slow processing of the code by using some performance related tools and check the response time is inevitable or not.
In general, if there are lots of looping in the logic we should avoid that but it totally depends on the situation.
I would recommend to contact to SAP professional services or others to check if there is any possible solution.
Regards,
Makoto