You are changing the expiration flow of GH by forcing the expiration while the component (and solution) is being made. Instead, you have to tell the document to re-solve and expire the component then. Replace GH_Component.ExpireSolution() with GH_Document.ScheduleSolution() method.
You have to put the count variable outside the body of RunScript, as a global variable within the Script_Instance class context, because this is the method that is called into the loop you are making. If the variable is initialized inside RunScript, each time it’s called it’s restarted. But if you have it outside, it only initializes once.