is there any way to change/modify a script written inside steps/variables/promotions/advanced settings which has multiple instances occurring in multiple configurations through automation?
You may find the object containing the script, change that and save relevant configuration. For instance, to change a step setting (which may include script):
groovy:
var confToModify = system.configurationManager.get("some_conf");
var stepToModify = confToModify.getStep("some_step");
// change settings of stepToModify
system.configurationManager.saveStep(stepToModify, stepToModify.name);