If your script is a .gameScript then this is a intended shortcoming of the current editor. But larian is looking into changing this. In case of a .itemScript or .charScript this could be a bug.
[...]
The required restart is currently intended, though we have been and are looking for a way to make this more user-friendly (making it work on a reload f.e.)
[...]