Well, there is a certain level of ambiguity to this question or maybe i am just overthinking things.
Removing the Element from the DOM
var scriptElement = document.querySelector('script[data-ghost="https://www.packetflow.co.uk/"]').remove();
This removes the Script element from the DOM but, if the script runs and affects elements before this line is run, ITS EFFECTS CANNOT BE UNDONE.
...
Since the script has a defer attribute, you could always make sure that your script with the remove line is located above it.
Removing the EFFECTS of the script
As aforementioned, this cannot be done after the script has been executed UNLESS you know eXactly what the script has affected in the DOM and are willing to reverse those effects with a countering script of your own.