The problem could be a number of things.
If this quest has already started before you load the save you're testing it on, it won't receive any OnInit events. This event is only received once the first time the game loads with the esp that contains the quest. Try it on a clean save that's never seen the quest.
Edit: Also, right now the script only registers for a single update, which means it will only check if the player is in the cell once (the very first time the game is loaded on a clean save). You could simply register for another update in the onUpdate() event (as andyw suggested), but that is not a very safe way to script, and may result in a lot of unneeded script processing/lag. Apologies, misread the function -- it will keep updating
However, still not the safest method to script this quest event--registering for updates is discouraged as it creates dirty saves.
The best way to set this up would probably be to put the script in a reference alias, and wait until the quest hits stage six, then have a script fragment on stage six that inserts the player into that reference alias. The reference alias itself can then have a script that will track the cell the player is in until reaching the desired target cell. You wouldn't even need a script attached to the quest itself in this scenario.
To try this method:
Make a new reference alias on your quest, check the "optional" flag without changing anything else and save the reference alias. Then add this script to the reference alias:
Scriptname aaaCellQuestScript extends ReferenceAliasCell property aaaCell001 autoQuest property aaaMainQuest01 autoEvent OnCellAttach()if Game.GetPlayer().GetParentCell() == aaaCell001if (aaaMainQuest01.getstage() == 6)Debug.MessageBox("Do Cool Stuff")GoToState("QuestFinished")endifendifEndEventState QuestFinishedEvent OnCellAttach() ;replace with an empty event to stop tracking the playerEndEventEndState
And add this script fragment to stage six of your quest:
ReferenceAlias property myRefAlias auto ;fill with the reference alias that has the above script attached to it.myRefAlias.forceRefTo(Game.GetPlayer() as ObjectReference)
You will need to fill the properties in the CK, of course.