Madagascar certainly ought to be an 'organic nation state'. It has natural boundaries - its an island, and by the beginning of the C19 the Merina monarchy had unified the whole island. The language is serviceable for administration and, later, education; most importantly it now has a usable latin alphabet. The various dialects of the island are not too different from each other and can all be brought together under the head of 'Malagasy'. There are no real minorities. After a pagan revival the island seemed prepared to settle down later in the century with a form of Christianity. And if there's no 'national story' or overarching tradition I'm sure the Malagasy ought to be a ble to create one.
The real difficulty is keeping out of European colonialism. I don't think they're capable of 'doing a Meiji', as the saying is, but with a bit of luck they ought to be able to do an Ethiopia, if not a Siam. If they can somehow screw the French (usually a good thing - oops, my prejudices are showing!) the monarchy can survive into the 20th century. The ultimate relationship between the aristocracy and the commoners is for the Malagasy themselves to decide. Even if they end up in the British sphere, perhaps they'd be a protected state rather like the Indian or the Malay States, with the administration largely leftin local hands.
I'd say that Madagascar has everything it takes to be a nation state - but it's not really in Africa, is it?