How to shorten code for “visRemoveNodes” using loop

Cross posted here, back on July 2nd, with no reply,

From: FAQ: Is it OK if I cross-post?