its not a hack at all
with this : set(hotspot[get(hsname)].onhover, showtext(get(hstitle), hotspotTextstyle));
you write a string "showtext(get(hstitle), hotspotTextstyle)" into the onhover attribute of the hotspot
the onhover action is executed later and has nothing to do with your choose_style(),
in the scope of the onhover action your variable hstitle is unknown / null
hstitle is defined / used in the scope of your action[choose_style] only
if you wouldnt use scope="local" in choose_style() hstitle would be global
but then all hotspots would use the content of the last iteration, which is wrong, too
... ps: just tested it... this can be really confusing:
set(a,"hello"); trace("a=",a); // hello
set(b,get(a)); trace("b=",b); // hello
set(c,showtext(get(a))); trace("c=",c); // showtext(get(a))
so in #2 get() gets resolved, but not in #3 (if it is nested)
in short: you need to take care when you compose event functions.