Becoming "sane," in O'Brien's view, is to accept "truth" as it is dictated by the Party. This is made clear during the sessions in which Winston is interrogated and tortured, but it's also a theme running through the entire story.
Orwell, as with other dystopian writers, takes the reality of his own time and extends it into the future by showing it in an exaggerated form. In both Communist and Fascist twentieth-century regimes, the rulers lied to their citizens again and again, yet expected, or demanded, to be believed. In 1984 when Winston is attending a rally, the speaker suddenly declares that Oceania is at war with Eastasia and in alliance with Eurasia. Although it is a reversal of what has been the case from the start of the novel, the populace is supposed to believe that this has always been true—contrary to what everyone's memory indicates. The evidence of one's senses and memory are to be subordinated to the absolute of whatever the Party declares as truth. This is what being "sane" means in the 1984 dystopia.
O'Brien tells Winston that he is taking the time to "re-educate" him, because Winston is worth the trouble, presumably because Winston is of above-average intelligence. Yet one wonders if this is ironically stated. Syme, who is apparently far more intelligent, had been simply "vaporized," though we don't know if this means that he's been tortured, like Winston, back into the orthodoxy he has shown earlier. Since Syme never reappears, one assumes he's probably been killed. Perhaps, then, Syme unlike Winston is too intelligent to be converted by the Party to "sanity."