What is your preferred definition of the first Stiefel Whitney class?
I'm more comfortable with classifying spaces (this is the only definition I can produce for Stiefel Whitney classes right now), and so I'd prefer to think of your description as whether or not the classifying map $f : B \to BO(n)$ factors through $BSO(n)$, i.e. whether or not the bundle is orientable (i.e. whether or not the transition maps can be taken to be determinant one).
Because of the short exact sequence $0 \to SO(n) \to O(n) \to \mathbb{Z}/2Z \to 0$, where the last map is the determinant, we get a fibration $B(SO(n)) \to B(O(n)) \to B(Z/2Z) = \mathbb{RP}^{\infty}$. The bundle is orientable iff the classifying map can be lifted to $SO(n)$ (up to homotopy), iff it can be homotoped to live in a fiber, iff the induced map to $\mathbb{RP}^{\infty}$ is null homotopic (homotopy lifting property for Serre fibrations), iff the determinant line bundle is orientable, iff the principle $O(1)$ bundle (2 sheeted cover) associated to the determinant line bundle is trivial. This is exactly keeping track of the $\pi_1(B)$ action on the orientation of a fiber.
The last bunch of equivalences can be used to solve the problem. The point is the the map from X to $RP^{\infty}$ is nullhomotopic iff the induced map on $H_1$ is trivial iff the induced map on $\pi_1$ is trivial, iff it is lifts to the cover which is $S^{\infty}$, and in particular contractible. (We use that $\pi_1(RP^{\infty})) = \mathbb{Z}/2$.) The induced map on $H_1$ is dual to the induced map on $H^1$ (everything is over a field*), so you can conclude from this, since the first Stiefel Whitney class is the pullback of the generator $w_1$ of $H^1(B(O(n))$ under the classifying map.
(*This gave me pause, so let me explain. This is pure homological algebra. We have two chain complexes of k-vector spaces, $C_*$ and $D_*$, an a map $f : C \to D$. We have a functor $F : k-Vect \to k-Vect$, $Hom(\_, k)$, which is exact. Then the induced map of $H_* (F(C_*))) \to H_*(F(D_*))$ is $F$ of the induced map $H_*(C_*) \to H_*(D_*)$. The point is that exact functors "commute" with taking homology of a complex.)
I'm assuming that $X$ is a CW-complex, because at some point I use a result about Serre fibrations, but probably this can be done away with. Let me know if you have questions, my writing here is hardly masterly exposition - I'm trying to understand this material as well.
This is very close to the content of The first Stiefel-Whitney class is zero if and only if the bundle is orientable but I think I address your question (about the action of $\pi_1$) more directly, and add some more detail.
If this is all nonsense to you (or other reader), I learned these ideas (except the mistakes) from these notes, which I cannot advertise enough: https://www3.nd.edu/~mbehren1/18.906/prin.pdf