Interesting question. I'm a full-time uniformed LEO and I've thought a lot about this.
First, I always carry a badge, and if God Forbid, I had to get involved when off-duty I'd have my badge in my creds case in my pocket. Always, without fail, I've got my badge if I'm carrying a gun.
However, I was talking to an old friend, a retired LEO, who works in the schools. We were talking about a school shooting scenario and asked if he'd get involved with his Resource Officer. He told me that they've talked about it and of course he'd get involved, doing whatever is necessary to protect the kids. This guy is retired from law enforcement, and now has long hair and a beard, and his plan is that he's going to surrender whenever uniformed officers arrive. He'll simply prone himself out and wait for the handcuffs. It's likely that the arriving officers won't know that he's a retired LEO and they can sort it out after the adrenaline calms down.