I know I’m literally almost a decade late but I was trying to detect if there were keyframes and I found this thread really helpful and thought I’d add to it for anyone else looking for a solution.
For my project I wanted a property to only use an expression when there were no keyframes and then basically let the keyframes takeover when they were present.
I ended up with this:
d = Math.abs(time – nearestKey(time).time);
if(d==0){
//key frame present
} else {
//no key frames
}