Bring them into a family. Add an instance variable representing Y.
+ (no conditions)
-> family: Set Y_Order to Self.?Y
-> System: Sort family Z order by Y_Order
And its done. Think they need to be on the same layer.
Additional, if the player is the only moving thing, start with (player) Is overlapping (Family), update for family and player (player is not in the family picklist). Now you can execute this 1000 times in one tick, dont matter.