Thanks for the link, but the fact it is 6 years old, and comes with warnings such as we’re not expert C hackers makes me very nervous.
Either way, if you want to tinker with opensshd I can recommend it as a starting point. It's very small, readable and easily tweaked.