Yugoslavia could have survived as an intact entity. The reasons it fell apart are several.
1) Serbian nationalism was a way of expressing dissent against the system. Eventually, other ethnic groups reacted against it. A less extreme version of Serbian nationalism could have developed instead. Or the Communists could have handled ethnic tensions better, perhaps by a more effective internal constitution. IOTL, once Communism collapse, Serbian nationalism was a way for post-Communists to quickly gain credibility and legitimacy.
2) There was a great economic disparity in Yugoslavia. Basically the north was developed and relatively rich, while the south was impoverished. Attempts to build up the south basically meant diverting resources from the north to the south which angered people in the north (Slovenes, Croats, some Serbs) to benefit Macedonians and Albanians. This created a lot of incentive for the northern republics to leave Yugoslavia once trouble started. You'd either need to have the south more developed before the mid 1980s, the north not feel exploited, or better economic handling all around.
3) Besides these general issues, there were several specifics that caused things to spiral out of control in 1989-1991. The Yugoslav economy was suffering from extreme stress at that time, exacerbating existing tensions. The new Yugoslav Prime Minister Markovic favored market based reforms to eventually revitalize the economy. He was being sabotaged by Milosevic who was using Sebian nationalism as his ticket to power. Yugoslavia had problems with hyperinflationa and paying off previous debts to the West. In 1990, Markovic asked for restructuring of Yugoslavia's debts and postpone their payment. Having that done would have bolstered Marovic in his political position at home. It would have enhanced his prestige and credibility while giving the Yugoslav economy room to recover and defuse tensions. But the various Western countries and institutions (IMF) at the time refused to do so. I think this is the critical time.
If Yugoslavia got the support it needed during this time, then it did not need to end in violence. Instead, with a modicum of support that allowed money that IOTL paid off Western debts instead went to supporting transfer payments to the republics, Yugoslavia might have survived. Once past the crisis point with a growing economy and other internal reforms, Yugoslavia would still exist today.