While it is true that Ocelot did not just act but also had the help of psychotherapy, hypnosis and nanomachines in order to behave in line with Liquid's persona, he preserved his inner conciousness. In fact, the official guide states it clearly:
<< Ultimately, the story of Metal Gear Solid 4 is the conclusion of a vast conspiracy through which Ocelot and EVA (with Naomi's help) exact their revenge on Major Zero, and open the doors of redemption for themselves. We should be under no illusions as to the true role of Ocelot from the very start. As Big Boss reveals, "In order to fool the system, Ocelot used nanomachines and psychotherapy to transplant Liquid's personality into his own mind. He used hypnotic suggestion to turn himself into a mental doppelganger of Liquid." Foreseeing every step that Snake would make, every likely outcome, Ocelot allows his apparent adversary to complete the most integral parts of his plot because he understands, fundamentally, that Snake is the tool of The Patriots and therefore above suspicion in their eyes -- whether he knows it or not. The evidence that underlines Snake's status as an unwitting agent of the Patriots' is abundantly clear. Drebin, of course, is a Patriot employee with a clear assignment to assist Snake whenever necessary; the same RAT PT 01 (an anagram of PATR10T) should leave no uncertainty as to the true benefactors behind Meryl's special forces team. Snake is the weapon wielded by the Patriots in the fight against Liquid Ocelot, and the new FOXDIE virus injected by Drebin a bullet with Ocelot's name on it.
Ocelot knows that the only way to bring down the Patriots is to infect the central AI, JD, with a virus. However, there are prequisites that must be met for his plan to work: one, that the virus code must be of a sufficiently high standard, and two, that he gave access to a system protected by an unprecendented degree of security.
Naomi creates a first draft of the virus, but is unable to complete it. Ocelot therefore consents to her apparent "escape" in order to deliver the code to Sunny, a child prodigy with a preternaturally instictive understanding of techonology, to finish Naomi's work. In her dying moments, only she understands the import of Sunny's message. "I cooked them right" is not a child's touching aknowledgement of earlier curlinary tips, but the confirmation that the powerful virus is complete. Her objects satisfied, Naomi coulf finally allow herself to die. Live Vamp, her grip on life was dependent on the artificial assistance of nanomachines; once this was removed, she --like Vamp-- exhales her last (suddenly visible) breaths in the cold Alaskan air before succumbing to the effects of the cancer within her.
As for how to deliver the virus into the heart of the Patriots' AI system, Ocelot knew that the only way to break through its security was to use a unique key: the genetic code and biometric data of Big Boss. In actual fact the body seized and then burned in Eastern Europe is not that of Big Boss, but Solidus -- the only one of the three brothers to be an exact clone.
The rest of the story is a series of deceptions designed to drive Snake ever onwards, and allay the suspicions of the Patriot AI systems. Ocelot, despite the presence of Liquid Snake within his consciousness, has no intention of using the rail gun retrieved from Metal Gear REX. Neither does he truly plan to become leader of the Patriots himself, despite his assertions to the contrary. Ocelot simply wishes for an end to The Patriots' control system, and leads Snake, their trusted yet unknowing tool, to become the agent of their ruin. For greater verisimilitude, at no point does Snake enjoy an easy ride: the sheer felocity of the forces ranged against him (soldiers, the Gekkos, the BB Corps, Vamp) underlines the apparent sincerity of Liquid Ocelot's desire to allay the legendary soldier. And yet Ocelot, significantly, fails to dispatch Snake when given several opportunities to do so, in a manner that clearly surpasses the traditional cliche of villainous arrogance.
Ocelot, then, is not a nefarious figure, a tyrant seeking endless power, but the mastermind behind a plan to break the authoritarian rule web that the Patriots were weaving over the world. From this perspective, Ocelot (even in his guise as the pitiless Liquid Ocelot) is as much a hero as Snake. Even his vicious rout of the forces brought by Meryl to capture him in Eastern Europe bears further examination. At the very moment that he froze military hardware throughout the world with an apparent nonchalant wave of his hand, didn't Ocelot effectively end all ongoing conflicts at once, becoming the main architect of peace and the man to end the war economy? Despite their mutual antagonism from the first time they met, Snake and Ocelot actually worked together to stop The Patriots' rule.
Only once the virus has been deployed does Ocelot reveal hints of his true self. There is an almost cathartic quality to the brutal unarmed combat that ensues between the two before Ocelot's life is extinguished by the FOXDIE that courses through Snake's veins. Ocelot's valediction confirms that he actually played Liquid's role all along: "I am Liquid's doppelganger."
The unforeseen variable in the story of MGS4, the protagonist that the Patriots completely neglected to acknowledge as a threat, is Sunny. It was her precocious genius that enabled the virus to consign The Patriots to history. As an additional, inspirational touch, she engineered it to destroy the AI routines that governed the world, and yet preserve the smooth running of infrastractures essential to modern civilization. By offering society a second chance, Sunny also gains a new beginning, this time "outside".
The symbol of this renewal, Meryl and Johny's wedding, is marked with several reconciliations: that of Meryl with her father Roy Cambell; that of Raiden with his wife and son, and ultimately with his life; that of Snake with his father, presumed long dead after Zanzibarland; and that of Big Boss with The Boss's legacy, which he finally understood.
Some, like EVA, Ocelot, Naomi and Big Boss (who deliberately breathes the FOXDIE virus exhaled by Snake) find redemption in death, both their own and in that of The Patriots' corrupted ideals. Others, such as Otacon, Meryl and Campbell, find redemption in life through their atonement for past mistakes. As for Snake, he finds himself poised between life and death, trapped between the past and the future, between Snake and David. There is, perhaps, a hint of a future, for the tired soldiers before the end credits roll. With the knowledge that the new FOXDIE virus has supplanted the one before it, Big Boss encourages Snake to start over, to embrace a new (albeit short) life as a fresh aura dawns. >>
The guide also clarifies the confusion on why EVA and Ocelot act as enemies in Act 3:
<< EVA died believing that Liquid Ocelot truly existed, as convinced as any other that her friend had become merely a vessel for Liquid's malign spirit. This was the true extent of the price that Ocelot had to pay in order to succeed: not even EVA could know the true scope of his plan. >>
EVA herself mentions that they were once allies with Ocelot but eventually she "lost" him. In Europe she knew that the body was Solidus which is why she is lying to both Snake, the Patriots' tool, and Ocelot who she thinks of as an enemy. She tries to convince everyone present in that scene that this is truly Big Boss's body so that no one will go after him.
In the ending, Big Boss says that Eva herself used body parts from Liquid and Solidus to repair his (Big Boss') body. Based on that, it's illogical to believe anything other than that Eva knew exactly what was going on, and that she knew that the body at the river was Solidus'. We learned in MGS3 that she was a graduate of one of the Philosophers' charm schools, so we know that she knew how to act and do what she wanted to get her goals accomplished. As for why she jumped in the fire, it seems extreme but you could say it was part of her act, she probably had decided to sacrifice herself for the ultimate end goal of ending the Patriots' reign, especially after her injury when she got knocked off the bike.
As to why Ocelot attacked Snake with the ship, wouldn't it be unnatural to command a giant ship, have your enemy right in front of you and just... leave? Ocelot knew that Raiden would come to Snake's rescue and used this to seem to try to kill Snake.
In a nutshell, Ocelot fooled the Patriots into thinking that he was the predictable and simple-minded Liquid, who they already have beaten once. If they knew that their enemy was Ocelot, who once presumed as their tool and so fully unpredictable, they'd never allowed Snake to deliver whatever virus by lowering their firewall in order for him to complete "their" mission. Even more so, I'd guess that they would've acted much earlier if they knew the real threat.