Stay away from runScript()
unless it is around single digit execution time (ms). Otherwise, my understanding is you could block other tag executions.
Edit:
If you need more complicated logic in an expression, check out the Integration Toolkit by pturmel.
It can do iteration, debugging, and more. Automation Professionals' Integration Toolkit Module - 3rd Party Modules - Inductive Automation Forum