Walkthrough of simple script creation. Script creates sets of elements selected by a sphere centered at user selected nodes. The final script can be found here.