Quoting "Keith F. Lynch" <kfl@KeithLynch.net>:
(Digression: Decades ago I noticed these same two kinds of symmetries in magic squares. How many order-4 magic squares with numbers 1-16 (or 0-15, or any other 16 equally spaced numbers) are there? The number usually given is 880, in which rotations and reflection are allowed. But you can permute the rows if you permute the columns the same way. That brings it down to 220. But there's also a very different kind of magic-preserving symmetry: Reverse the order of the numbers. That doesn't knock it down to 110, however, due to a broken symmetry, i.e. that transform sometimes links an arrangement back to a permutation of itself rather than to a distinct arrangement. If I recall correctly, it knocks it down to 166. I recall that at about the same time I was counting 4x4 magic square, our listmaster was doing the same with 5x5. I recall reading that he used the row-permutation symmetry, but I don't know whether he also used the number reversal symmetry.)
I implicitly used most of the N <=> 26-N symmetry. I varied the center cell C from 1...13 (only), and reported the total count of 5x5 magic squares for each center value. Then I doubled the total for C = 1...12 and added the count for C=13. This saved about half the time. I decided not to use the value symmetry for C=13: It complicates the program, and increases the chance of an undetected bug. You can only use some of the row (and column) permutations: You can permute the rows in the left half (minus the center row if N is odd), and do the mirror permuation in the right half. Then follow up by choosing some (or none or all) rows in the left half, and exchange each with its mirror row in the right half. Then do the same things to the columns. A curious consequence of the center row (and column) being fixed in the center, is that the size of the group of allowed permutations is the same when N=2K or 2K+1. Rich