I respectfully disagree with the answers given, thus far. It may be because I'm old school, and do not agree with some of today's grammar/punctuation thoughts of "do what looks good."
You do need the comma before and. If you were to take out as such from the sentence, no one would argue that you need a comma before and.
Once I was sitting with a group of children who had just been caught shoplifting, and some of them were hiding themselves behind others.
(FYI - You also don't need the word, themselves, in this sentence....and to confuse things further, you need a comma after Once.)
I do, however, understand what Peter and Joao are saying. All the commas may make the sentence confusing to the reader. In situations like this, I tend to rewrite the sentence to avoid any awkwardness. For example...
Once, I was sitting with a group of children who had just been caught shoplifting. As such, some of them were hiding behind others.
I just don't believe we should have to change long-standing, basic grammar/punctuation rules to fit today's writing. I know...old school. 😉