With all due respect, I think closing the question / answer just because the user doesn't follow coding standards is not correct.
We mostly code in PHP for our Drupal development. And if one is familiar with PHP and Drupal API, it won't be difficult for a person to understand what the OP is trying to do (even if the code does not follow coding standards).
Also, the Coding Standards for Drupal, mainly deal with formatting the code (i.e. making it more readable and easy for maintenance), rather than pointing out the use of (or flaws behind) the logic behind the programming (as there can be many different ways to solve the same problem, depending on the user's understanding).
So, when an user posts a question containing code which does not follow the coding standards, we should encourage other users (who are aware of the coding standards) to go ahead and edit the post and adjust the code to make it compatible to the coding standards (of course, without changing anything in it; which would change the logic behind it). And after editing you should leave a comment in the Edit summary of the question that the edit was made to adjust the code to the coding standards, which would make the OP aware about the coding standards when s/he sees the summary of the edit.
Yesterday, an user posted an answer to the question and posted the code which was not formatted according to coding standards. I've edited the post and adjusted the code to fit the coding standards without actually changing anything. You can see the edit summary here. I've also mentioned in the "Edit summary" - code formatted according to coding standards.
So, my answer to the question would be, we should support the questions / answers that doesn't follow the standards, but should encourage the users the adhere to them; as many of the newbies are not aware that the standards are actually present.