Inside a Business rule, you can also use action called "Run script".
If you go to business rules and try to create one, you will most likely not see this option. Here is the trick.
This action is only available on the forms connected to the Task flows (accessible from mobile interface and the new unified interface).
So you need to create a new Task flow or open existing one. The go to Business rules.
Create a new Business rule there. You will notice, that this Business rule is only valid on the form which name is the same as the Task flow. It cannot be modified.
I would suggest putting only simple script here, as it is not stored as a Web resource and cannot be managed well.
I am using it for simple logic which must be implemented in the Task flow. I can access fields, change their properties and so on. But basically, any code will run. I did not hit any limit in terms of max number of characters.
I will keep investigating it and post any updates.