Thank you for your post. In this case with any API manipulation you could also consult with the Autodesk Developers Network (ADN). There are resources and tools to help with programming and API manipulation. I have included the link below.
ADN: http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=2484975
A side note would be if there was a way to minimize the excessive amount of phases? Yes, you can add them but as the complexity increases, more phases introduced, there could be a possibility for communication break down. Could the project be broken up at all to minimize this and possible enable more fluid transitions between the phases (thinking form a design aspect versus a software support aspect).
Where there are always ways to improve overall functionality, I would strongly urge all community participants to utilize the development product feedback link (below). This link is a powerful way to speak directly to our development team on the specified product to help encourage change in the current programming and features.
Product Feedback: http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=1109794
Keep in mind that in Revit demolition dosen't need to be separate phase. Think of it as the first step in a given phase. Use Show Previous + Demo for demo plans and Show Previous + New for new work plans.
Would that reduce the number of phase you have?