Replace while() with while(true) and don't forget the brackets. There needs to be a Waitframe(); instruction at the end of the while loop, otherwise ZC will forever wait for the next frame and freeze.
Quit() needs to be in both conditions; however since both conditions do exactly the same thing, you can save space and merge them with || (OR) : if(Screen->State[ST_SECRET]==true || Screen->NumNPCs() <= 0)
It should be ffc script and not item script. Item scripts are triggered by items.
Note that this script would trigger the earthquake if secrets are activated OR all enemies have been defeated. I would guess you only want one of these, and not both. It would also do this every time you reenter the screen, if the secrets are still activated or if the enemies are still gone. You'd probably want to check for that before the loop, and quit if the earthquake already happened.