I am not sure with the last step when it applies the short-five lemma, which suppose to be the commutative diagram

In order to apply the 5-lemma, we will need to show in addition (1) $\text{Hom}(\mathscr{E}_0,\omega)\cong H^n(X,\mathscr{E}_0)'$ and (2) $\text{Hom}(\mathscr{E}_1,\omega)\to H^n(X,\mathscr{E}_1)'$ is an epimorphism.
My question is: Why both (1) and (2) are true? Thank you in advance for your answer. It will be the best if you can present the corresponding morphisms.

We know from the proof that (b) holds for any finite direct sum of $\mathcal{O}(q_i)$.
We also know that the $\mathcal{E}_i$ are such direct sums (notice there is a typo : Hartshorne forgot the word finite but it should be clear you can have it).
Thus (b) hold for the $\mathcal{E}_i$. But (b) tells you exactly that the maps $$Hom(\mathcal{E}_i,\omega) \rightarrow H^n(X,\mathcal{E}_i)'$$ are isomorphisms.