The answer to this is pretty simple. There is no syntax highlighting in the comments. At most you can wrap your code in the usual back-ticks to give it somewhat of a different appearance, but that's about it.
You should not be posting substantial amounts of code in the comments anyway. They are not meant for that. Nor are they meant for extensive discussion or for content which should be guaranteed to stay around for a long time.
If you can, you might be better off making it an answer. If you can't, well, then you're stuck with the current limitations of comments and I can't see that changing any time soon.