=Neil Sloane There are a bunch of other sequences all of this class [...]
Per Polya maybe we should start with an easier problem? Specifically: What numbers do we get if we also identify opposite edges of the grid? Then all the translations along the glued directions of a given "configuration" are the same. Moreover, gluing merges cases (iii) & (iv) since "interior" vs. "exterior" becomes arbitrary. This suggests 4 new systems of related OEIS arrays (or even 9 if we include twisted grids).
there ought to be a generating function, or some kind of formula.
Can we isolate the "edge effects" into a subexpression that modifies a symmetrical formula?
=Tom Duff using the stupidest possible program
"Things should always be made as stupid as possible, but no stupider." --Herbert Einstein