Script loss bug fix

This adds a listener for the itemSelectionChanged signal to update what item is currently selected in the script editor. It's a proposed solution to address this bug:

https://bugs.launchpad.net/mudlet/+bug/1377401

And if valid, will be applied to other treewidget items since that bug extends to those as well.