I have years of experience with Mikrotik and scripting for it, although it is not shell scripting.
If you can provide me existing script and the list of changes required, I can fix it for you quickly.
All of the code will be well commented, so in the future it will be easy for you, or someone else, to make adjustments, if needed.