While this question may or may not have a theoretical answer, the practical answer is that you should slow down to 20 mph if there is any chance that the school zone speed limit will be in force at any time that you pass through it.
If you do, you will definitely not be cited.
If it is at all a close call (say within five minutes of being active), normal differences in time keeping between unsynchronized watches and a lack of any way to prove precisely when you vehicle was where and traveling at what speed, mean that the question of whether the school zone was in effect at the time you were cited will be a question of fact to be resolved based upon the credibility of the witnesses. The witnesses will probably be only the citing officer and you. As a practical matter, you are going to lose the credibility contest on this question of fact 95%+ of the time, and that credibility determination will not be an issue that could be raised on an appeal.
Therefore, you should slow down before entering the school zone if it is remotely close to being time for it to be effective to leave a sufficient margin of error against traffic law enforcement officer inaccuracy, which includes any time that the school zone takes effect while you are in it.
Even if you could perfectly prove that you were half way through the zone when the speed limit fell from 30 mph to 20 mph, the argument that you needed to break suddenly to comply doesn't cut it. Violating a speed limit is a strict liability offense and you have a duty as a driver to anticipate what you need to do to comply with the law at every stage of your journey. Even if your speed was legal when you entered the zone, you knew or should have known that it was on the verge of being triggered and should have slowed down in advance.