A user on reddit was having an unspecified issue with your script, so I took the liberty of reworking it (I really hate nested binds). Advantages include enhanced mousewheel tracking with your number/numpad keys, and mousewheel tracking is no longer reset when the active team is toggled or when switching between modes 6v6 and 6v6-compact.
Feel free to use, integrate, or disregard, but I figured I might as well post it. It's untested, so there's a high likelihood of a typo or two.