$$ \begin{align} \int_{|z|=1}(z^2+2z)^{-1}dz=\int_{|z|=1}\frac{1}{z(z+2)}dz= \\ =\int_{|z|=1}\frac{1}{2z}dz+\int_{|z|=1}\frac{1}{2(z+2)}dz= \\ =\int_{|z|=1}\frac{1}{2z}dz+ 0= \\ =\frac{1}{2}\int_{|z|=1}\frac{1}{z}dz+ 0= \\ =\frac{1}{2}(2\pi i)=\pi i \end{align} $$
Is my calculation correct or have I done something not permitted, $\int_{|z|=1}\frac{1}{2(z+2)}dz$ is $0$ due to cauchy's theorem.
Sure, it's fine!
Let me underline what you have done in each step.
$$ \begin{align} \int_{|z|=1}(z^2+2z)^{-1}dz=\int_{|z|=1}\frac{1}{z(z+2)}dz= & \text{ Inverse the fraction}\\ =\int_{|z|=1}\frac{1}{2z}dz \color{red}{-} \int_{|z|=1}\frac{1}{2(z+2)}dz= &\text{ Perform a partial fraction decomposition}\\ =\int_{|z|=1}\frac{1}{2z}dz+ 0= & \text{ Cauchy's integral theorem: } \small{\oint_\gamma f(z) = 0, \ f \text{ holom.} }\\ =\frac{1}{2}\int_{|z|=1}\frac{1}{z}dz+ 0= & \text{ Factor out the } 1/2\\ =\frac{1}{2}(2\pi i)=\pi i & \text{ Residue theorem: } f \text{ holom. in } z \in \mathbb{C} \backslash \{0\} \end{align} $$
Hope it helps.
Cheers!
Appendix:
for the calculation of $\oint_ \gamma \frac{1}{z^2} \, \mathrm{d}z$ you can use the residue theorem (I think it's the faster way), provided all the required conditions are met, being $n = 2$ the order of the pole $c = 0$. Then:
$$ \oint_\gamma \frac{\mathrm{d}z}{z^2} = 2\pi \mathrm{i} \times 1 \times \lim_{z \to 0 } \frac{\mathrm{d}}{\mathrm{d}z} \frac{(z-0)^2}{z^2} = 0 = 1-e^{\mathrm{i} \, 2 \pi} = \int^{2 \pi}_0 \mathrm{i} \, e^{-\mathrm{i} \, t} \mathrm{d}t,$$
where in the last steps I have included the straightforward calculation using $z = e^{\mathrm{i} t}, \ t\in (0,2\pi)$.