how to calculate the initial concentration of NaOH in a mixture?
As @MaxW pointed out, if you assume that the volumes are additive implies that your total volume is 40 mL. Now, remember the definition of molar concentration:
$$C=\frac{\text{moles solute}}{\text{total volume}}=\frac{n}{V}$$

That means that the concentration and the volume are inversely proportional, thus if initially, you have a $\text{0.0400 } \frac{\text{mol}}{\text{L}}$ in 20 mL and then you increase the volume twice, then your concentration decrease to the half of initial value. In numbers:
$$\frac{\overset{\text{this are your moles of solute}}{\overbrace{\frac{\text{0.0400 mol}}{\text{1 L}}\times{\text{20 mL}}}}}{\underset{\text{this is your final volume}}{\underbrace{\text{40 mL}}}}=\text{0.0400 }\frac{\text{mol}}{\text{L}}\times\frac{1}{2}=\text{0.0200 }\frac{\text{mol}}{\text{L}} $$