Now that overrides are much more complex (which is good), getting a list of overrides for a symbol instance returns a lot more results. Previously when they were 1:1, if I wanted to select the layer for the override it was pretty straight forward. Now, you need to take an additional step to filter the override results by unique path, otherwise you'll end up trying to select the same layer multiple times (because each layer has multiple overrides available now).
Basically, the following is an updated method to select layers in the layer list, within a symbol instance, that match the provided name. Hopefully this helps anyone dabbling in this realm.
const sketch = require("sketch")
const util = require("util")
const document = sketch.getSelectedDocument()
const documentData = document.sketchObject.documentData()
const selections = document.selectedLayers
const selection = selections.layers[0]
let layerName = 'Oval'
let instanceOverrides = util.toArray(selection.sketchObject.overrideContainer().flattenedChildren())
let uniqueOverrides = []
instanceOverrides.forEach(o => {
let overrideMatch = uniqueOverrides.find(u => u.availableOverride().overridePoint().path() == o.availableOverride().overridePoint().path())
if (!overrideMatch) uniqueOverrides.push(o)
})
let selectOverrides = uniqueOverrides.filter(o => String(o.availableOverride().affectedLayer().name()) == layerName)
documentData.setSelectedOverrides(selectOverrides.map(o => o.selectionID()))
I've published this as a gist as well - https://gist.github.com/sonburn/b6e64279700dbd57e8e086c63125c6a5