In a question recently deleted by its author, it was asked that given $$ K=\{z:z^{1020}=1\text{ and }z^4\ne1\} $$ what is $$ \sum_{z\in K}\frac{1+z}{1-z+z^2-z^3} $$ It seemed that this question might benefit from the method used in this answer, this answer, or this answer, even though this question did not involve trigonometric functions as did the questions for those answers.
Of course, other approaches are most welcome.
Residue Solution
Note that for $$\newcommand{\Res}{\operatorname*{Res}} g_n(z)=\frac{n/z}{z^n-1} $$ we have $$ \Res_{z^n=1}(g_n(z))=1\tag1 $$ and $$ \Res_{z=0}(g_n(z))=-n\tag2 $$ Partial fractions gives $$ \begin{align} f(z) &=\frac{1+z}{1-z+z^2-z^3}\\ &=\frac{(1+z)^2}{1-z^4}\\ &=-\frac1{z-1}+\frac1{2(z-i)}+\frac1{2(z+i)}\tag3 \end{align} $$ For $g(z)=g_{1020}(z)-g_4(z)$, we not only have $\Res\limits_{z\in K}(g(z))=1$ and $\Res\limits_{z=0}(g(z))=-1016$, but also $$ \begin{align} \lim_{z^4\to1}g(z) &=\lim_{z^4\to1}\left(\frac{1020/z}{z^{1020}-1}-\frac{4/z}{z^4-1}\right)\\[6pt] &=\lim_{z^4\to1}\left(\frac{1020}{z^{1021}-z}-\frac{4\left(1+z^4+z^8+\dots+z^{1016}\right)}{z^{1021}-z}\right)\\[6pt] &=\lim_{z^4\to1}\frac{1016-4\left(z^4+z^8+\dots+z^{1016}\right)}{z^{1021}-z}\\[6pt] &=-\frac{4+8+\dots+1016}{255z}\tag{L'Hôpital}\\[6pt] &=-\frac{508}z\tag4 \end{align} $$ Thus, $$ \begin{align} \Res_{z=0}(f(z)g(z)) &=f(0)\Res_{z=0}(g(z))\\ &=1\cdot-1016\\[6pt] &=-1016\tag5 \end{align} $$ and $$ \begin{align} \Res_{z=1}(f(z)g(z)) &=g(1)\Res_{z=1}\left(\color{#C00}{-\frac1{z-1}}+\frac1{2(z-i)}+\frac1{2(z+i)}\right)\\ &=-508\cdot\color{#C00}{-1}\\[6pt] &=508\tag6 \end{align} $$ and $$ \begin{align} \Res_{z=i}(f(z)g(z)) &=g(i)\Res_{z=i}\left(-\frac1{z-1}\color{#C00}{+\frac1{2(z-i)}}+\frac1{2(z+i)}\right)\\ &=508i\cdot\color{#C00}{\frac12}\\[6pt] &=254i\tag7 \end{align} $$ and $$ \begin{align} \Res_{z=-i}(f(z)g(z)) &=g(-i)\Res_{z=-i}\left(-\frac1{z-1}+\frac1{2(z-i)}\color{#C00}{+\frac1{2(z+i)}}\right)\\ &=-508i\cdot\color{#C00}{\frac12}\\[6pt] &=-254i\tag8 \end{align} $$ and $$ \begin{align} \Res_{z\in K}(f(z)g(z)) &=f(z)\Res_{z\in K}(g(z))\\ &=f(z)\tag9 \end{align} $$ Since $f(z)g(z)\sim\frac4{z^7}$ as $|z|\to\infty$, the sum of the residues vanishes: $$ \begin{align} 0 &=\sum_{\alpha\in\{0,1,i,-i\}\cup K}\Res_{z=\alpha}(f(z)g(z))\\[6pt] &=\sum_{\alpha\in\{0,1,i,-i\}}\Res_{z=\alpha}(f(z)g(z))+\sum_{\alpha\in K}\Res_{z=\alpha}(f(z)g(z))\\[6pt] &=-508+\sum_{z\in K}f(z)\tag{10} \end{align} $$ which means $$ \bbox[5px,border:2px solid #C0A000]{\sum_{z\in K}\frac{1+z}{1-z+z^2-z^3}=508}\tag{11} $$
Mathematica Verification
Using the code
N[Plus@@((1+z)/(1-z+z^2-z^3)/.Complement[Solve[z^1020==1],Solve[z^4==1]]),20]we get
508.00000000000000000 + 0.*10^-18 INotational Clarification
In the preceding, $\Res\limits_{z^n=1}(f(z))$ means the residue at any point $z$ so that $z^n=1$. This may be a function of the root of $z^n=1$ chosen.
Also, $\lim\limits_{z^4\to1}f(z)$ means the limit at any point $z$ so that $z^4=1$. This may be a function of the root of $z^4=1$ chosen.