In your first claim, it is a bit unclear what bundle you are considering. It is false for the tangent bundle of $\mathbb{C}P^2$: $\mathfrak{P}(w_2) = c_1^2 = 9 \; {\rm mod} \; 4$, while $p_1 = 3$. The context of the question you link to is arbitrary oriented rank 3 bundles over a 4-dimensional base. Is that what you have in mind?

The Pontrjagin squares in the cohomology of $BO$ were first computed by Wu in
*On Pontrjagin classes. III* (MR0115179).
It is not so easy to get hold of a digital copy of the paper or its
translation, but one of the main results is Theorem 5 of Section 4:

$$\mathfrak{P}(w_{2i+1}) = \beta_4 Sq^{2i}w_{2i+1} + \theta_2(w_1
Sq^{2i}w_{2i+1})$$
$$\mathfrak{P}(w_{2i}) = \rho_4 p_i + \beta_4(w_{2i-1}w_{2i}) + \theta_2
\left(w_1 Sq^{2i-1}w_{2i} + \sum_{j=0}^{i - 1} w_{2j}w_{4i-2j}\right)$$
where $\rho_4$ is mod 4 reduction of coefficients, $\beta_4$ is the mod
4 reduction of the Bockstein map $H^i(-;Z/2) \to H^{i+1}(-; Z)$, and
$\theta_2 : H^i(-;Z/2) \to H^i(-;Z/4)$ is induced by the inclusion $Z/2
\to Z/4, x \mapsto 2x$.

As a special case, we find that for any orientable vector bundle (i.e. $w_1 = 0$)
$$ \mathfrak{P}(w_2) = \rho_4 p_1 + \theta_2(w_4) . $$

It's worth pointing out the corollary that Wu deduces from the above calculation (and that Stiefel-Whitney classes are homotopy invariants by Wu's formula): the mod 4 reductions of the Pontrjagin classes of a closed smooth manifold are homotopy invariants.