You have the bring in front/back in the sprite actions. They might be easyer.
For the system Z-order action, you need to give instances an instance variable, and give each a value. Z-order will sort depending on that value. Hence, it only orders instances. Newly created objects need a value givven to that instance variable.
Unless you have access to families. Then you can use a familie variable to sort.
Renember that you can not read from a newly created object until the next top-level-event. Meanig, you can NOT use the sort action in the same sub level as the creation action.