For example, one barn I took lessons at had lesson horses and boarders, and all the lesson horses were in one aisle, and they got some paint and painted a nice thick line across the aisle at the end of where the lesson horses and lesson stuff was, and it was pretty clearly stated that if you were there for a lesson you stayed on the lesson side of the line unless invited. Seemed to work pretty well - obviously other boarders bringing their own kids would be a different issue, but the vast majority of kids were for lessons, so it helped a lot.
Likewise, the indoor arena had a viewing area fenced off at one end. If you wanted to watch, you watched from there. No hanging out by the gate or whatever. Clear rule, everyone knew it, everyone reminded everyone else. If you were not riding or helping with a lesson, you did not belong on the arena side of the fence. Since they were very specifically defined areas, it seemed a lot easier for kids to remember where they were and were not supposed to be.