Editting Script from Tool doesn't update opened script in Script Editor

I’m leaving here a link to an answer to a post of mine that resolves this issue, at least for Shader Editor files. It should work for scripts too. Credits to mrcdk.