There is plugin that sort all objects in layer automagically.
Another way to do it is to place all your objects that are supposed to be sorted to same layer and family called "ZOrder", then add this event:
Every tick
for each ZOrder (sort by Y ascending)
.. ZOrder move to bottom of layer
This can (and should) be optimized a bit if there are lots of objects.