I don't think it's wrong to require that deactivated #if blocks still are syntactically correct at the token level. If it's a pike file it's still pike code in those parts too - things like comments and string literals must be considered to correctly decide whether something that looks like a cpp directive really is one or not. The preprocessor is not language independent.
The problem you run in to is due to that you want to use two languages with different tokenization rules in the same file. The imho logical way to cope with that is to run some kind of transformation on them before they are ever fed to the language specific preprocessor and compiler. Maybe you can use a language independent preprocessor like m4 or a custom loader that rewrite the files before feeding them to cpp() and compile(). Make a custom master and override compile_file and compile_string, perhaps?
I'm not sure the "fix" that Nilsson made to ignore invalid cpp directives in deactivated blocks is a good one. It can make errors harder to detect, e.g. if you happen to write "#elsif" in there.