That was just my way of saying you repeat this structure for more switches/lights. That part wasn’t intended to be entered verbatim.
Yes, I believe you’d have to have an individual entry for each switch for which you want a “light wrapper”. Maybe there’s an easier way, but if there is, I’m not seeing it.