what you're trying to do pretty much cannot be done in a filter that isn't the source filter itself, so have fun with that
Why not, you ask?
Pretty much all source filters just throw an exception when retrieving a frame fails, and once that happens it's game over and you can't do shit. You usually cannot restart decoding in a safe way once the exception is thrown, even if we presume that you actually manage to catch the exception in the first place (which in and of itself is decidedly nontrivial to do from inside a plugin, since most likely the script environment will catch the exception before you ever get to see it; you will need some serious C++ voodoo to catch it before someone else does, if it's even possible at all).
Assuming that you actually do manage to catch the exception, in many (most?) cases you'd either need to reinit the decoder and/or reopen the source file in order to restart decoding at the next frame in a safe way (since once the exception is thrown, all assumptions about the decoder state are completely useless), and you can't do that from inside another plugin.
Furthermore, you need to consider that most modern codecs use predictive or even bidirectionally predictive coding, which means that if decoding frame X fails, decoding all frames that depend on X (possibly the entire GOP, which is typically 2-300 frames) will also either fail completely, or succeed with serious artifacts.
edit: if you're actually trying to just drop frames that are green, and not detect actual decoding failures, then ignore the above. dropping green frames is relatively easy.