As a user with full editing privileges, I will either add a relevant tag that automatically turns on syntax formatting such as the JavaScript tag, or I will add [syntax-highlighting hints](http://meta.stackexchange.com/questions/184108/what-is-syntax-highlighting-and-how-does-it-work) to explicitly tell the Stack Exchange's Markdown parser what language the code is, for example:

    <!-- language: lang-js -->

        if (foo) {
            alert("Shazbot!");
        }

However, a low-rep user like yourself without full-editing privileges should try to improve the post as much as possible: if there are any other problems with the post (grammar, spelling, missing punctuation, etc.) please improve them as well.

If adding a relevant tag or syntax highlighting hint is the only thing to improve in a post, I would personally approve such an edit, tho many other users reject edits like these as too minor.

If there's nothing else to improve in the post and your edit is still rejected, I would just move on and find another post to edit instead.