I am trying to solve the following problem. As per my understanding, the scalar projection of $\vec{p}$ along $\vec{b}1$ should be
$\vec{p}$ . $\vec{b}1$ / |$\vec{b}1$|
Then why do we divide by |$\vec{b}1$| twice? To get the correct answer we need to use the following formula instead, but why:

Rather than using the formula above, I would say:
$v = c_1 b_1 + c_2 b_2\\ c_1 + c_2 = 5\\ c_1 - c_2 = -1$
And now I have a rather simple system of equations.
At a deeper level of understanding, I might say:
$T = \begin{bmatrix} 1 & 1 \\ 1 & -1\end{bmatrix}$ would be a transformation from the basis $B$ to the standard basis.
In which chase $T^{-1}v$ would transform v in the standard basis to the basis $B.$
As for what you have in your formula above.
We take $b_1$ and we normalize it.
i.e. $u_1 = \frac {b_1}{\|b_1\|}$
Then we calculate the dot product.
$v\cdot u_1$ giving us a magnitude in this direction. Multiply by the direction vector
$(v\cdot u_1) u_1$
Substituting back
$(v\cdot u_1) u_1$ = $(v\cdot \frac {b_1}{\|b_1\|}) \frac {b_1}{\|b_1\|} = \frac {v\cdot b_1}{\|b_1\|^2}b_1$