Consider the dihedral group $D_4$. Find the centralizer of each element of $D_4$.
The elements of $D_4$ are $\{1,r,r^2,r^3,s,sr,sr^2,sr^3\}$
We know that $Z(D_4)=\{1,r^2\}$.
Now centralizer of $r,r^2,r^3=\{1,r,r^2,r^3\}$.
Also $s$ commutes with $sr^2$ hence centralizer of $s,sr^2=\{1,s,sr^2\}$.
Also centralizer of $sr,sr^3=\{1\}$.
Is my computation correct?
Is it true for all even $n$ ,$ s$ commutes with $sr^{\frac{n}{2}}$ and no other element?
Not correct.
The centralisor of an element is a subgroup of $D_4$. In particular, Lagrange's theorem tells us that the order of a centralisator must divide $8$. Thus, your centralisator for $s$ isn't even a subgroup. Another way to see this is because $s(sr^2)= r^2$ isn't an element in your set. Thus, adjoining the element $r^2$ gives the full centralisator of $s$ (there can't be more elements because Lagrange would imply that $s$ centralises everything and then $s$ lives in the center, which is not the case).
Note also that every element is contained in its own centralisator, thus your answer for the centralisators for $sr, sr^3$ can't be correct either.
Since $r^2$ is in the center, it commutes with everything and thus its centralisator is $D_4$. So this is wrong too.