When first introduced, ProcessDefinition and ScriptTemplate were part of ScalarFunction however the concept proved to me much more generic.
For example arithmetic operators were transformed into functions (despite not being one); the same situation needs to be applied with the rest of the operators, namely the comparison and some predicates (Like/RLike).
In fact, most (if not all) expressions require these as they can appear both on the invoking node and inside a script.