This script converts the current selection to a symbol and replaces the selection with an instance of that new symbol. The same can be achieved by Shift clicking on the Create New Symbol button at the bottom of the Symbols Palette.