You don't need to get a ceasefire to avoid excommunication (which is fortunate, since AI factions will rarely agree to a ceasefire). In my current Italian campaign, I've been in a cold war with the English for years after having received the Papal warning, without being excommunicated.

After you receive the warning, you have one more year in which to launch attacks and/or withdraw from castles you are sieging. Thus you must either immediately launch your castle assaults, or withdraw and give up your newly conquered lands.

After that, you cannot make any aggressive military moves against the nation you have been warned against attacking. This includes naval attacks; it also includes attempting to break sieges on your own castles (even a sally is considered an attack). You can still use assassins. This state of affairs continues for ten years, of course.

Note that your enemy can still attack you without fear of Papal retaliation, unless he controls far more territory than you. (I think he'll only get excommunicated if he's twice your size.) The Pope will only protect the weaker faction.

As others have noted, only one warning can be in effect at a time (however, I have seen multiple excommunications at the same time). Thus, if you attack one faction and get warned, you can then proceed to attack other Catholic factions at will, and the Pope will not bother you. Just make conquests elsewhere for ten years, then resume your earlier war.

One more observation: it seems to me that excommunication is really not that bad. The only time it's become a serious problem for me is during one English campaign in which my king was excommunicated at a young age, and the excommunication dragged on for a long time. Loyalty started dropping all over the kingdom and I had to send my king to a suicidal death - but by then, he was already very old.