The script editor always snaps to the Output window instead of the game viewport upon opening a script. This is extremely inconvenient to reposition each time and disrupts development workflow. This issue persist after restarting Studio and I’m not aware of any steps to reproduce this problem.
Thank you for the bug report. We can reproduce this issue internally and are working on a fix.
As a work-around, what appears to be happening is that the Script Editor attaches to the leftmost Tabbed dock widget (which happens to be your output in this example). You can undock the Output widget and re-dock it as a non-tabbed dock widget by pulling it out of the main window and re-attaching it using the far left docking option.