Yes the script above deselects the parent.
Well thats because maya or rather YOU the operator have hard time seing what is selected and what is not. Since the higlight will color all nodes underneatth the sselected transform. You can still click on those objects to delselect them but theree will be no visual feedback on this.
The rasoning is that maya does indeed not highlight whats selected BUT rather whats affected by the selection. Why... well because you hardly ever select the objects themselves but rather a tranbsform dowstream (it does not realy matter if its downstream by 1 step or 1000). Now maya undrstands this and also understands that multiple things can be one object.
However maya has hard time doing the opposite wich is the downside of this wonderfull sytem. Treating everything as individuals. Partly because thet would be worse than the way it does now. Because thatway youd never se whan you selected the parent. (now maya could color them differently for you!)
Now personaly im confident enough so thet i can pick those objects blindly and know ive done so without much problems. Even tough i dont get any visual feedback of it,