Interesting, I don't have this issue. If the FF menu is visible, it is ignored and the content / application menu is activated. (This is FF ESR 45.7.0)

If however, the SDM tab does not have the focus (for example, I selected the New Tab above), then the script would not see SDM as a background and bring it forward but it would not activate the FF menu either. Since the WinWaitActive was used, then as soon as the SDM tab was focused, the script would see it and perform the View->Refresh sequence.
I think you can manipulate this as you did or go further and rotate through tabs until the one is in focus. At that point, you can have one browser window with multiple tabs as views and take action in each as needed.
It's been a while (and I don't have time to do it now), but I have used this as a very small and portable tester for function and load.. Once you get a scenario in place, you can then simulate user functions and login, create, modify, and logout.
I'm glad this helps you.
J.W.
#autoit #automation