If these changes are for your script or while preparing for an NSIS build and not runtime you should use the NSIS preprocessor or if you need more power (or to process non-NSIS scripts) a general preprocessor such as my free one would be a better choice. If interested have a look at:
Now if anyone has an NSIS function for seach replace a string then please let me know!
Bye
Dennis