Well, sometimes just giving into AI demands is not enough, sometimes the AI still sneak-attacks. At least in each of my OCC games, I have been sneak attacked by the AI. So, an OCC war plan is still called for.
My experiences are as follows.
The most important AI to you is your neighbor. During peace time, you need to try to improve relations with him as much as possible. When a distant AI declears war on you, sign up your neighbor as you ally, and buy a ROP with him. This way, he will pick off those AI landing parties for you too. Buy the alliance with gpt if possible, this way if he back out, you get your money back.
It also helps that since your neighbor gets to expand into your territory, he is usually the most powerful civ in the world. So, you get more value out of any resources that you're trading to him; he can fight off aggressor for you without much problem; and he has the resources to buy more allies to fight on your side.
It's actually to your advantage to fight a little during the war, but only fight a defensive war, avoid losses at all cost. Unit loss is a major factor when it comes time to calculate the cost for peace. If you have a unit out in the middle of nowhere, disband him. Chances are he will be picked off by some fast unit.
Use a combination force to defend your capital. Artillery units are very important, so are offensive units. You goal is to fight a war with zero loss, and the only way to do that is with bombardment followed by attacks. Of course, you still need some defensive units just so that some freakish run of RNGs don't end your game.
All of that is assumming your closest neighbor is not attacking. If it's your closest neighbor turning on you, well, things get alot more interesting. You will have no hope of beating him by military, so signing up an ally against him is the first proriorty. Hopefully, there is an AI out there that can threaten one of him own cities on his home continent. The AI will pull troops out of your land to defend his own cities.
Artillery units are the key. You can spead your artillery fire, injurying each of his units to buy yourself some time. Or, when the situation cools down a bit, you can concentrate your fire on a few units to pick them off. Killing his units is important because it's the only way to get a decent peace deal from him.
As you can tell, all of this has happened to me before in my games. This is the last turn of one of my OCC games (if you hit enter, you'll win next turn).
http://www.civfanatics.net/uploads2/SJ-Frank-Emperor-OCC-win.zip
In this game, I'm at war! With my neighbor no less.
The Romans had sneak-attacked about 8-10 turns ago, almost as if they knew they were about to lose the game by culture. (It was also the second time in this game that they sneak-attacked me).
The first 2-3 turns of the war were hairy. The Romans sent about a dozen tanks and Mech Inf. into my territory. My artilleries fired, hit and injured some, but there were enough roman units attacking on the second turn to make it close. My infantry defenders were able to held, barely. By this time, I had dragged the other world power into war on my side. The Roman injured units left, never to be heard from again.
How close was it? Well, if you look at the defensive units in the city, only the infantries were build before the attack...