If my opponent used Magnemite's "Mirror Shot" attack last turn, and I try to use my GX attack this turn and flip tails, do I lose the ability to use a GX attack for the rest of the game?
No, because since you flipped tails the attack "doesn't happen".
Source: Cosmic Eclipse FAQ (2019-10-18), TPCi Rules Team (2019-10-31)
If my opponent uses "Mirror Shot" on my Active Pokemon, would I still have to flip a coin for my attack if I retreat?
No, retreating would clear the effect of Mirror Shot.
Source: Undaunted FAQ (2010-09-09), PUI Rules Team (2010-09-09)