I have a quick question about this proof I wrote (not created by me) a while back.
Let $a$ and $b$ be integers with $b > 0$. Then there exist two integers $q$ and $r$ such that $a = bq + r$ with $0 \leq r < b$.
For the first case ($0\in S$), it states that $q=\frac{a}{b}=\frac{bk}{k}=b$ but then states that $a=bk=bk+0=bq+r$. Why suddenly $k=q$? Is this a typo? Should it be $a=qk+r$?

Yes it is a typo. But the typo is that $q = \frac ab = \frac {bk}{b} = k$ so $q$ was supposed to be $k$ from the beginning.
$q = b$ is the error, and so, no, it should not be $a = bk + 0 = qk + 0=qk+r$. That wouldn't get us anywhere toward proving $a = bq + r$ as the $k$ has nothing to do to do with the divisor $b$ which has suddenly disappeared. In fact if $q= b$ then that would mean we are trying to prove $a = b^2$ which is ... not the case.