Advantage of applying a Window Function in Analysis and Synthesis of STFT?
The STFT is an instance of an Analysis/Synthesis system. If we restrict to windows of finite length, it amounts to windowing blocks of length $L$, taking the DFT, and hopping by $K$ samples to perform the same operation. An A/S system is said invertible, or perfect, if you can recover the original signal from the blocks of DFT coefficients.
If $K&gt;L$, some samples are missed, there are holes between blocks, and generally some information is lost (unless you have additional information).
If $K=L$, blocks are contiguous, and do not overlap.  Here, the transformation is critical, or non-redundant: you have the same numbers of Fourier coefficients than of samples. In that case, you can invert it even with non-rectangular windows. It suffices that the windows don't vanish, because windows without zero-values can be inverted (and Fourier as well).  There is only one inverse in that case. This is for your first question.
If you allow  overlap $K&lt;L$, then several things may happen. I shall come back later, but basically:

a proper synthesis window can make a system with a vanishing analysis window invertible;
it can reduce artifacts resulting from  performing processing after the analysis stage (frequency removal, thresholding etc.);

In the continuous time domain, if you have an analyzing window $h(t)$, for any synthesis window such that
$$ \int_{-\infty}^{+\infty}g(t)h^*(t)\mathrm{d}t = 1$$
then the continuous STFT is invertible. Several observations:

These are very mild conditions to satisfy. This should not be surprizing, the STFT is extremely redundant, so the information is everywhere in the time-frequency plane
yes, you need a second window in the synthesis time-frequency plane (but it can be the same)
The windows $h$ and $g$ are complementary in second-order. Many possible $g$ exists, and especially:
$g=h$, provided that $ \int_{-\infty}^{+\infty}h(t)h^*(t)\mathrm{d}t = 1$ which is easy if the window does not have zero energy.

In the discrete-time/discrete-frequency domain, this is far more complicated in the general case. Yet, for power-of-two frame length, for certain window (triangle, Hann) and overlap ($1/4$, $1/2$, $3/4$), there exist direct inverses, easily computed from the analysis window. One shall compensate a bit in amplitude (like in your case), by a factor related to overlap and redundancy. Those cases are often standard, as they are quite easy.
However, there are generalized inverses, that allow for less redundant decompositions, at a cheap prices.
Related answers:

Meaning of Hop-Size in Filter Bank Interpretation of Short Term Fourier Transform
Normalizing STFT output and calculating energy of signal