Not knowing what the heck to do with a script to run it is a common problem!
To start try opening Script Editor in your Applications > Utilities folder, then simply copying and pasting a script into that. With the OO document open and (for some of the scripts) a row selected, simply click the 'triangle' run button in Script Editor. That's it!
If a script turns out to do what you want and you think you will use it then there are ways to activate a Script menu at the top of your screen and put the script in there so it becomes like any other menu pick. But first get a script to do what you want before trying that.
I quickly tried the first and scripts in the thread you referenced, and I'm not sure they do exactly what you describe. They seem to collapse the outline to a certain level but leave the lower level rows in the document. It may be necessary to have the script actually delete rows with collapsed parents (in a copy, not the original of course!). But try them out. It's basically copy, paste, click.