Is the IEP supposed to be written before the meeting?

Usually the IEP is written during the meeting with the team's input. The team is gathered to discuss the goals for the student and the agreement about the goals is reached at the meeting. That doesn't mean that testing, diagnosis, and a framework about what should be covered or discussed isn't done ahead of time. The parent should definitely have a say in the IEP, so if it is written ahead of time then the parent would not have a say.