Support for user-defined functions

When building a complex formula, it would be nice to be able to write custom functions to improve readability. For example, while a formula reacting to rain could be written as if(wi(icon)="RAIN"|wi(icon)="SHOWER"|..., it would be nicer to create a separate function is_rainy that could then be used inside the formula, encapsulating the not-so-readable boolean condition.

The current workaround for this is to simply create a global variable which fulfills the same purpose, but this can get very cluttered with many globals.

In addition to that, there could be an option to give functions inputs, so I could have a function receive data.

bump; this has been something I've been wanting for a few years now. Maybe it's a niche use case, but at least for me it would help clean up lots of code, as being a mobile app, the script editor screen can become very cluttered and hard to read.