When I'm moving a node around with the keyboard shortcuts and "move right" to make it a child of a collapsed headline, that headline expands and the node ends up at the bottom of the list. To collapse the parent headline, I need to either mouse up to it and click on it, or use the arrow keys to navigate to the parent. And if I'm in structure mode (where the headlines are highlighted), then I need to arrow left once I've reached the first child of the parent node. This script allows you to collapse the parent node just by choosing Collapse Parent from your scripts menu.
You can also append these three lines to another script if you've used the op.reorg verb to do something like move a child node to the next parent's house.
op.go (left, 1);