Scroll Wheel Macro?

Hi. I’m wondering if it is possible to make a macro or script that replace the up and down spells (surge forward, etc.) for controlling your dragon.

What I’d like the macro to do is if I am Dragon Riding, then up-mouse-wheel = Skyward Ascent, down-mouse-wheel = Surge Forward and when not Dragon Riding these work as default (zoom in or out).

Thanks in advance if anyone can figure this out.