Since your edits still have to be peer-reviewed in the review queues, you should do your best to make edits that significantly improve a post instead of edits that could be described as superfluous.
In case of a question, if the question is not good enough to remain open you should stop and think if your edits are going to make the question good enough to save it from closure.
If the question was close-worthy before you suggest an edit, and remains close-worthy after, the case can be made that the your suggested edit is actually superfluous.
And more often than not, only the OP can edit a question beyond the closable threshold. There are, of course, many exceptions; but I think that the general rule is that it is much easier to improve someone else's question than to save someone else's question.
To make matters worse, you may be very well be hampering the questioner. E.g. if the edit gets approved after the post is closed; it will be sent to the re-open queue before the OP had a chance to actually improve their post to the point is salvageable, and nobody will vote to re-open.
But this happens only the first time a post is edited. If the OP later on wants to edit and improve their post so it gets re-opened, they'll find it much more difficult (since subsequent edits wont send the post automatically to the re-open queue).
In the specific case you linked, the post doesn't contain any code: Linked code, code in the form of an image (or linked images of code) do not count as code. Your edit didn't change that, and reviewers took note.
It doesn't matter that the code wasn't actually linked and visible in the original revision and that you subsequently inserted it as an inline image: code present as an image doesn't count at all, and that's all your edit did.
While code (contained in either a linked image or an inline image) could be transcribed, that's the OPs job; potential answerers are not meant to work as human OCRs.
There is no harm on having an edit rejected. As @Machavity says, this is simply the system improving itself by teaching you to make better edits in the future. If you use this opportunity to learn from it, your future edits will better and will get approved and content on the site will get better. Happiness all around!