The question you ask is a special case of what is called the membership problem.
The membership problem: Let $G$ be a group, and $H$ a subgroup. Is there an algorithm which takes an element $g\in G$ and outputs whether $g\in H$?
In this case $G=S_8$ and $H=\textrm{Sym}(\textrm{cube})$. For arbitrary groups, the membership problem is undecidable, however for subgroups of permutation group it is decidable, and the most well-known algorithm is called the Schreier-Sims algorithm. This runs in polynomial time.
One can implement this algorithm in your particular case, but there is also a more elementary method if you set up the labelling on the cube in a clever way. In your question you didn't specify how the vertices are labelled, but as you pointed out in the comments relabelling doesn't fundamentally change the problem.
For my labelling I am not going to use $\{1,2,\dots,8\}$, instead I will use $\{1,2,3,4,\bar{1},\bar{2},\bar{3},\bar{4}\}$. I am going to label according to the figure below. Notice I have chosen the labelling to represent the fact that the cube contains two regular tetrahedra inside it which together define its eight vertices. On the level of groups this reflects the fact that the symmetry group of the tetrahedron, $S_4$, is an index two subgroup of $\textrm{Sym}(\textrm{cube})$.

Now, as a subgroup of $\textrm{Perm}\{1,2,3,4,\bar{1},\bar{2},\bar{3},\bar{4}\}$, the symmetry group of the cube is generated by $S_4=\textrm{Perm}\{1,2,3,4\}$ (which is the group of symmetries of the blue tetrahedron) together with the permutation $$\sigma=(1\;\bar{1})(2\;\bar{2})(3\;\bar{3})(4\;\bar{4}).$$ This has the effect of swapping the red and blue tetrahedra, and as a symmetry is the antipodal map.
Now suppose we have an element of $\textrm{Sym}(\textrm{cube})$, then it can be expressed as a finite combination of permutations $g_1\sigma g_2 \sigma g_3\sigma\cdots\sigma g_n$ of some length, where the $g_i\in S_4$. We can ask what such a product looks like in cycle notation.
Well if $g\in\textrm{Perm}\{1,2,3,4\}$, then $\sigma g\in\textrm{Perm}\{\bar{1},\bar{2},\bar{3},\bar{4}\}$. Similarly, if $h\in\textrm{Perm}\{\bar{1},\bar{2},\bar{3},\bar{4}\}$, then $\sigma h\in\textrm{Perm}\{1,2,3,4\}$. Therefore, the element $\sigma g_2 \sigma g_3\sigma\cdots\sigma g_n$ will lie in either $\textrm{Perm}\{1,2,3,4\}$ or $\textrm{Perm}\{\bar{1},\bar{2},\bar{3},\bar{4}\}$, depending on whether $n$ is even or odd. Thus $g_1\sigma g_2 \sigma g_3\sigma\cdots\sigma g_n$ will be one of the following
- An element of $\textrm{Perm}\{1,2,3,4\}$
- An element of $\textrm{Perm}\{\bar{1},\bar{2},\bar{3},\bar{4}\}$
- A product of two permutations, one from $\textrm{Perm}\{1,2,3,4\}$ and one from $\textrm{Perm}\{\bar{1},\bar{2},\bar{3},\bar{4}\}$
Moreover it is easy to see that every permutation which is in one of these forms is a symmetry of the cube. Therefore we have proved the following easy solution to the membership problem in this case:
Proposition: An element of $\textrm{Perm}\{1,2,3,4,\bar{1},\bar{2},\bar{3},\bar{4}\}$ lies in $\textrm{Sym}(\textrm{cube})$ if and only if each cycle lies in either $\textrm{Perm}\{1,2,3,4\}$ or $\textrm{Perm}\{\bar{1},\bar{2},\bar{3},\bar{4}\}$.
Edit: after posting my answer I saw OP had added a couple of extra comments. To relate my answer to those, note that each of the four diagonals of the cube has exactly one endpoint in the blue tetrahedron, and one in the red tetrahedron. Tus thinking about permuting diagonals is equivalent to thinking about symmetries of one of the tetrahedra. The corresponding $S_4$ subgroup, which I said was index 2, is the group of orientation preserving symmetries of the cube.
The issue raised in the class summary is about recognising the type of symmetry of the cube (rotation about a vertex, rotation about the midpoint of an edge, reflection, etc) which is not the question you asked, and so not the question I have answered.