Perhaps I'm missing something here, but why use image detection? It seems that all you need to do is get the position of the divider at the end of the name column then tell KM to double-click there.
Making the assumption that "Name" is column 1 and with no error checking (that can all be had from @ccstone's script -- Chris is better at that than me!).
Finder -- expand column 1.kmmacros (3.8 KB)
This is working consistently for me in Sonoma, with a couple of exceptions -- both "Downloads" and "Applications" have really weird numbers for "position of column 1" which bear no relation to what you actually see!