How to calculate the pH of the neutralisation of HCN with excess of KOH? Write the reaction between $\pu{0.05 mol}$ $\ce{HCN (aq)}$ and  $\pu{0.08 mol}$ $\ce{KOH (aq)}$ with $V = \pu{500 mL}$ and then calculate the pH.


So I wrote the reaction:
$$\ce{HCN (aq) + KOH (aq) &lt;=&gt; KCN (aq) + H2O}$$

Begin:
\begin{align}
  n_\mathrm{begin}(\ce{HCN}) &amp;= \pu{0.05 mol}\\
  n_\mathrm{begin}(\ce{KOH}) &amp;= \pu{0.08 mol}\\ 
  n_\mathrm{begin}(\ce{KCN}) &amp;= -\\
  n_\mathrm{begin}(\ce{H2O}) &amp;= -\\
\end{align}

End: 
\begin{align}
  n_\mathrm{end}(\ce{HCN}) &amp;= -\\
  n_\mathrm{end}(\ce{KOH}) &amp;= \pu{0.08 mol} - \pu{0.05 mol} = \pu{0.03 mol}\\ 
  n_\mathrm{end}(\ce{KCN}) &amp;= \pu{0.05 mol}\\
  n_\mathrm{end}(\ce{H2O}) &amp;= \pu{0.05 mol}\\
\end{align}

The product of the reaction is a salt of a strong base ($\ce{CN-}$) completely dissociated in water:
$$\ce{KCN (aq) -&gt; K+ (aq) + CN- (aq)}$$

And
$$\ce{CN- (aq) + H2O -&gt; HCN (aq) + OH- (aq)}$$

Knowing this I calculated the 
$$[\ce{KCN}] = \frac{\pu{0.05 mol}}{\pu{0.5 L}} = \pu{0.1 M};$$

Then I used the equation:
$$[\ce{OH-}]_1 = \sqrt{\frac{K_\mathrm{w}}{K_\mathrm{a}} \cdot [\ce{KCN}]} = \pu{1.27x10^-3 M}$$

Since I still have some $\ce{KOH}$, it dissociates completely creating $\ce{OH-}$ ions, so:
\begin{align}
  [\ce{OH-}]_2 &amp;= [\ce{KOH}]\\
  [\ce{OH-}]_2 &amp;= \frac{\pu{0.03 mol}}{\pu{0.5 L}} = \pu{0.06 M}
\end{align}

Finally
\begin{align}
[\ce{OH-}] &amp;= [\ce{OH-}]_1 + [\ce{OH-}]_2 \\
&amp;= \pu{1.27x10^-3 M} + \pu{0.06 M} = \pu{0.06127 M}\\
\ce{pOH} &amp;= -\log[\ce{OH-}] = -\log(0.0617) = 1.213\\
\ce{pH} &amp;= 14 - \ce{pOH} = 12.787\\
\end{align}

Is it right to calculate the $[\ce{OH-}]$ in this way?

I based my calcualtions on this equation:
Knowing that the amounts of substance in moles are defined by $Z = Z_1 + Z_2$ in $K$ liters of solution, we can consider this concentration to be 
$$[X] = \frac{Z}{K} = \frac{Z_1 + Z_2}{K} = \frac{Z_1}{K} + \frac{Z_2}{K} = [X_1] + [X_2]$$
While you've generally done a good job, you've made an important error. The hydrolysis of the cyanide ion should be written as an equilibrium reaction:

$$\ce{CN-(aq) + H2O(l) &lt;=&gt;  HCN(aq) + OH-(aq)}$$

That's because $\ce{HCN}$ is a very weak acid and its conjugated base a weak base (homework: look up the $K_b$ of $\ce{CN-}$).

Now, as you duly noted, there's excess $\ce{KOH}$ in the solution, which dissociates completely. The $\ce{OH-}$ resulting from that dissociation now push the equilibrium:

$$K_b=\frac{[\ce{HCN}]\times[\ce{OH-}]}{[\ce{CN-}]}$$

to the left. As a result, the contribution of the $[\ce{OH-}]$ coming from the hydrolysis of the cyanide is negligible and can be ignored. Only the $[\ce{OH-}]$ from the excess $\ce{KOH}$ is to be counted. So $[\ce{OH-}]\approx 0.06\ \mathrm{mol/L}$.

We can confirm that numerically by assuming $[\ce{OH-}]\approx 0.06\ \mathrm{mol/L}$ and with:

$$\frac{[\ce{HCN}]}{[\ce{CN-}]}=\frac{K_b}{[\ce{OH-}]}\approx 0.0027$$

So neglibibly little cyanide is present as the acid $\ce{HCN}$.



As regards the matter of adding molarities, in some instances that is allowed.

Say we add $n_1$ moles of $X$ to $V\ \mathrm{L}$, that would give a molarity $M_1=\frac{n_1}{V}$. At a later stage we add $n_2$ moles of $X$, that molarity would be $M_2=\frac{n_2}{V}$.

The total molarity would be:

$$M=M_1+M_2=\frac{n_1}{V}+\frac{n_2}{V}=\frac{n_1+n_2}{V}$$

But if we were to mix volumes of solutions it would be:

$$M=\frac{M_1V_1+M_2V_2}{V_1+V_2}$$

Now  they are no longer simply additive.