Agree with you in regard to the rules in place, but the list of those retired and brought back on active duty for a courts-martial is mighty small, and normally is for something egregious that occurred while on active duty.
But, that's not to say that it's impossible for some brass to decide the retiree brought discredit to the service (particularly while wearing the uniform) and made statements which indicated the service (or at least a ranking officer) endorsed a candidate and decides an example should be made.
And, in this climate......I think personal opinion should be personal opinion. If she's the first woman to whatever - great. There still isn't a reason to don the uniform and then go make those statements.
It's hard to see that b/c we may agree with her RE Hellary. I imagine the tune would be different here if it was against Trump, or another conservative.