It's hard to give any general advice, depends on what you are trying to do and if it's possible to achieve the same thing with some other type of script.
For example, I wanted to make a script that counts the amount of yes/no votes and if there is a 66% majority, the vote succeeds. If the divide function worked in Stellaris, I think it would be very simple to divide yes_votes variable by no_votes variable and see check if the result was 2 or greater.
Instead I made a script that substracts two 'yes votes' and one 'no vote' from each variable every time the event loops around until various conditions are met which determines if the vote goes through.
Ah. I'm needing to make a specific object the value of a variable, though from what I've heard, that's not actually possible.