I don’t think those scripts will necessarily trigger a ban because nothing about those tasks directly involve Overwatch. However as a general guideline, you should only have “one keypress for one action.” That is the only permitted stance for Blizzard games so think about it carefully and choose the best action at your own risk.
Note, most modern keyboards have “function” keys which access volume controls usually through a special key labeled FN and is then connected to usually F number keys. You might want consider updating your keyboard to something with such a feature if you really want to play it safe and have reasonable convenience to your volume controls.