Let $M$ be a closed connected manifold and fix a basepoint $q \in M$ and a Riemannian metric on $M$. Let $F(M)$ denote the orthonormal frame bundle of $M$. This is a principal $O(n)$-bundle over $M$ ($n = \dim M$). The homotopy sequence of this bundle reads $$\dots \to \pi_2(M,q) \to \pi_1(O(n),I) \to \pi_1(F(M),F_0) \to \pi_1(M,q) \to \pi_0(O(n),I)\to\dots$$ where $F_0$ is a fixed frame over $q$. Let $\pi_1^{\text{or}}(M,q)$ be the kernel of the penultimate arrow; this is the subgroup of $\pi_1M$ represented by "orientable" loops. Then we have the group extension $$0 \to A \to \pi_1(F(M),F_0) \to \pi_1^{\text{or}}(M,q) \to 1$$ where $A$ is the quotient of $\pi_1(O(n),I)$ by the image of $\pi_2(M,q)$. Assume $A \simeq \mathbb Z_2$ (which happens for $n \geq 3$ and $w_2(M) = 0$, I think). Then this is a central group extension and therefore we have the associated class in the second group cohomology $H^2(\pi_1^{\text{or}}(M,q);\mathbb Z_2)$. What can be said about this class in terms of the topology of $M$? Does it have to do anything with Stiefel-Whitney classes? When is it trivial?

It seems that when $M$ is orientable and Spin, then this class is indeed trivial; moreover different splittings of this extension correspond to different Spin structures.

A reformulation of this is as follows (I'm adding this just to give an additional perspective): the above fiber bundle gives rise to the associated based loop space fibration $$\Omega SO(n) \to \Omega F(M) \to \Omega^{\text{or}}M$$ and the group extension is obtained by looking at the last terms of the corresponding homotopy sequence.

And lastly, it looks like this should be understood in the broader context of principal bundles and characteristic classes. If someone can point me in the direction of understanding this or give a reference, that'd be great.