This is very speculative.
A terrorist act might actually solidify nationalism and support the current ruling party. Just take a look at Bush's numbers after 9/11. But when governments make decisions that citizens believe inflames terrorism, they might tend to vote for a change. Either way it certainly brings an element of instability to the voting process.