Imagine if that law was strictly applied during the Bush presidency.
Bush didn't sue, Erdogan did.
Law is law, it doesn't matter that it's outdated. It exists and as long as it exists, Erdogan has the right to sue someone based on this law.
Whether or not Böhmermann's poem is protected by the freedom of arts or an insult against the law is then up to a court to decide. (The verdict likely being that, nope, Böhmermann did nothing wrong; worst case a judge will say that he despite his intentions he went a bit too far, which will end up with Böhmermann having to pay a bit of money).
Whether or not the government agrees to the "insult against a state president" lawsuit doesn't even matter
much, since the general lawsuit for insult won't be affected by that decision. Böhmermann could still go to prison based on that. But he won't.