Use of scripts is detailed in the Adobe Illustrator Help files:
http://helpx.adobe.com/illustrator/using/automation-scripts.html
A simple Google search for "How to use a script in Adobe Illustrator" or a search of the help files for "scripts" would have both turned up results.
To use that script (or any script for an Adobe application)....
- Copy that script code to a text file
- Save the text files as plain text (you can not use Word for this. You need a plain text editor - on Windows use Notepad, on a Mac use TextEdit) and title it whatever you want adding a .jsx suffix. So the final file should be something like "AddStrokes.jsx"
- Place your .jsx file into
Adobe Illustrator CSx/Presets/[language]/Scripts
- Relaunch Adobe Illustrator
Now open your artwork, select some objects and choose File > Scripts > AddStrokes
(or whatever you titled your file).
For the record that script does function correctly. At least in Illustrator CS6.