I looked at your script and for me it is working
In the script you have to make at least 3 selections
1-The face(s) of the wall(s) you want to have the tubes
2-A selection of the family to be placed (grout tubes)
3-A selection of the family to be placed on top (tube on top)
In this case I just used the same family for both tubes
The families have to be a face based.
Louis
Please mention Revit version, especially when uploading Revit files.