Is it possible to predict that a language is about to die out just by looking at its structure? So without taking into account the number of native speakers it has and other external factors? If so, how?
You can somewhat predict language death from current available data on the language, but not from the structure itself. A factor that accompanies language death is that speakers have significant uncertainty as to what the facts are. The reason is that the speakers hardly use the language anymore: so, if you have a really incoherent corpus of data, this suggests that the language is falling out of use. Abrupt social upheaval, where most of the speakers are killed and dispersed, could lead to isolated pockets of individual fluent speakers.
A language dies when nobody learns it as their first language. The factors leading to this are generally social and cultural ones: maybe it becomes more prestigious to speak Spanish than Q'anjob'al, so Q'anjob'al is used less and less, or perhaps the government makes it illegal to speak Dyirbal so it never gets passed on.
Could a language die out just because its structure was no longer useful? It's possible for parts to die out: all of Latin's ablative inflections are dead and gone, for example. But the language as a whole lives on; there's an unbroken line of transmission between Cicero's Latin and modern Italian.
Languages are constantly changing under a strong evolutionary pressure, adapting to be as useful as possible for communication. If part of a language's structure is making communication harder instead of easier, that part will quickly wither and die. But a community won't go from speaking one language to zero: having any language is better than none. Language death only happens when social factors bring in competition.