Detecting varying PWM states

Yeah, give it a try, it may just make it.

Otherwise an opamp or comparator (or opamp wired as comparator) or even a simple Schmitt trigger will get the job done.