You've likely already discovered the answer, but I'm going to post it to help out with whoever else might stumble across this page.
Lets use the colors red (r), green (g) and blue (b). We see that there are three ways for us to label the pentagon (up-to-symmetry): (r,g,b,g,b), (r,g,b,r,g) and (r,g,b,r,b). Since there is only one way to draw each of these pentagrams, then the pattern inventory becomes
\begin{align*}
rg^2b^2+r^2g^2b+r^2gb^2.
\end{align*}
Consider the rotational symmetries of the square cuboid. If we define the longitudinal axis to be the y-axis, then there is a rotation about the y-axis of order $4$, that is the rotation of $90$ degrees, this has the following elements:
$$R_0, R_{90}, R_{180}, R_{270}$$
Their matrices are represented by the unitary orthogonal $det = 1$ matrices with the eigenvector $(0, 1, 0)$ corresponding to the eigenvalue $1$.
Then there is a rotation going through the x and z axis, each of order $2$ and 180 degrees in both directions, this yields 4 rotations of order $2$. Again, this corresponds to the orthogonal matrices with eigenvalue $1$ and corresponding eigenvector $(1, 0, 0)$ and $(0, 0, 1)$. We have just counted $4+4$ rotations, and four of them are in the form of $R_0, R_{90}, R_{180}, R_{270}$ and the other four are of order $2$... sound familiar?
Perhaps not very coincidentally, this subgroup of rotations is actually a copy of $D_4$ (check by the presentation definition of a dihedral group, that is it can be generated by two involutions), such that:
$$D_4 = <a, b \ | \ a^n = b^2 = I, (ab)^2 = I>$$
$D_4$ is normal in the symmetries of the square cuboid (since it has index $2$, used by the assumption given in the question before, that is has $12$ isometries). Noting that the entire symmetry group can be composed by all the rotations and a single reflection, consider the point of inversion $-I$. It is trivial to prove that $\{I, -I\}$ is normal as well. (noting that $-I^{-1} = -I$).
What have just showed? We have showed that the symmetries can be composed via two normal subgroups with only the trivial intersection, the rotations being isomorphic to $D_4$ and the set $\{I, -I\}$ being isomorphic to $\mathbb{Z}_2$ (you can check this manually be reviewing the subgroup of matrices).
Indeed the symmetries of the 4-prism is isomorphic to $D_4 \oplus \mathbb{Z}_2$
Additionally, more simply is that once you have composed the entire rotation subgroup in the square cuboid, you know that it is symmetric about the origin (the tetrahedron defies this). Since it is symmetric about the origin, that means you can take the direct product with $\mathbb{Z}_2$. This immediately yields the intended isomorphism.
Best Answer
Let's do the Burnside. There are $8$ symmetries (I like to think of them geometrically rather than in abstract cycle notation). The number of squares which are invariant for each of these symmetries are:
Burnside's lemma then tells us that the number of distinct squares, taking the symmetries into account, is $$ \frac{84 + 0 + 0 + 12 + 36 + 36 + 0 + 0}8 = 21 $$