If it's not political, and you agree with his assessment of your production code, then there's an R&D role that probably needs filling and that you've already proven you can do - finding profitable market niches and creating prototype products/services to address them.
Don't sweat being a "bad coder". Every coder (yes, even the awesome ones) feels a little worried that their code is bad, and he's just playing on this insecurity that we all have. Part of the 'your code is crap' syndrome we see in tech is just defensive projection.
You managed to build a production system that is gaining traction, which is amazing. Go do more of that :)