Couple thins, first, why are you using such a complex macro? Second, if I'm reading this correctly (my Lua is not so good) then you are calling some mount form the mount pane, by number, based on whether it's usable or not in your zone. If the outcome of the macro is changing, one might also suspect that the order of the mount pane is changing (in classic Blizzard style, with extremely strong coupling between model and view :S), is this the case?

Can't you make a table of mount_name -> number_in_mount_pane mapping and use that? Basically using the names of the mounts instread of their index?