I do have some question about the magnetic storm. The galaxy edge is 20,000 light years away (the rim) or about 3000 l.y. (the upper or lower surface) and that's an awful long way to be tossed.
Like I said: Wormhole. The storm probably was
a wormhole of some kind.
Or perhaps it was the same effect that would later sweep Voyager
all the way into the Delta Quadrant. The space service of Kirk's era might not have understood exactly what that was, so they just called it a "magnetic space storm" because that's the best phrase they could come up with.