Can you please post your code for your function? I was very happy to find this thread because I'm up against something similar; I need to find the color of the existing color overlays on layers with a script. While you found a solution with help from the forum, it doesn't help others unless you post it!
I'd really appreciate seeing it,
Thanks,
Tom.