Render cells are usefull when used with layers that contain non moving objects. And a lot of non moving objects. A lot ? No, a big WORLD of non moving, static objects. Z-order is then maintainted once, only once.
In fact, render cells are an improvement if you notice an improvement, else they are not. Thats the rule.
About the 'hidden loops' you use. When there are 2 loops nested with counters that go from 0 to 9, that nested loop will run 100 times allready.
Now, when you use 'Pick by evaluate', that is actual a loop, behind the scenes of course. It loops trough all (specified) objects and evaluates them. It is a fast loop, nevertheless a loop. Using families, that can be a bunch of objects. Using two families containing the same objects is actual a nested loop. 100 objects in the famelies = allready 10.000 times that it has to evaluate.
Then you call the function. With again 2 'hidden loops'.
Yeah that gets CPU demanding. For ALL objects in that family. If you really want to do this, then you to have filter both familys with the 'is on screen' before giving them to the first evaluate. That will allready do a lot.
Oh, and, our friend Rex has a plugin to Z-order.
http://c2rexplugins.weebly.com/rex_zsorter.html