Here we're working with nested lists. Foreach steps through each element of the outermost list, and works on the contents of that element. Typing (car (nth cnt layerlist)) is exactly what the foreach functions is doing, except you don't have to tell foreach how to get to the next element. So, some pseudo-code: foreach list in variable layerlist, save each item in the list to its own variable i.e. (car, cadr, caddr) and process these items as needed before looking at the next list in the main list and continue until every list in the main list has been stepped through.
Sorry if I keep going over the same things, but I want this to click for you. I used repeat for 4 years before I figured out foreach. It wasn't until I asked Mark about it and realized that I was missing one crucial element in my code, to making foreach work. That element was a list. I knew it processed multiple items, but I failed to realize that selection sets and lists are not the same. Anyway, where are we at? What's next?