I checked with the team and unfortunately, right now you can't remove unused JS Scripts. We do have this on Duda's Idea Board, definitely give it an upvote!
We continuously release improvements to optimize page speed, some of our most recent improvements are reflected in the recently updated Google CrUX report which shows how websites perform across the Core Web Vitals metrics.
You can check out this video where our Core Web Vitals expert @Russ_Jeffery talks more about this report:
We’re keeping this idea open and will continue to update as more improvements are made.
It's worth noting, that if there are just a couple of unused JS lines, that is not the reason why a site is has a slow loading time, and I'd look at other potential impacts.