One thing that is worth clarifying IMO: There is nothing inherently “scientific” about Sanskrit as a language by itself: instead what's remarkable are
1. the Sanskrit grammatical tradition, as represented especially by Pāṇini. The Sanskrit grammarians paid special attention to language, and their careful study culminated in a grammar by Pāṇini that was centuries ahead of its time, and is still throwing up new insights. The last several generations of modern linguists have read their own ideas into Pāṇini: from William Jones at the start of historical linguistics to de Saussure to Chomsky to Kiparsky. (The last of whom is an expert in both Sanskrit and modern linguistics.) Panini occupies a place in Indian thought equivalent to that of Euclid in Greek, and explicit comparisons have been drawn between the two. (E.g. all students were expected to master them respectively, these were the sciences that all others sought to emulate, ...) (I remember reading somewhere something to the effect that: among achievements of civilizations, the Egyptians have their pyramids and India has Panini's grammar.)
2. the cultural fact that, Pāṇini's grammar having been so exhaustive/complete, it became regarded as the definition of correct Sanskrit, and culturally for centuries everyone who composes in Sanskrit has just chosen to stick to this grammar. This "froze" Sanskrit and gives it a timeless quality: Sanskrit poets composing today use the same language that would have been comprehensible centuries ago; learning this one language opens up literature spanning 2500 years. With other languages that evolve naturally, this is difficult: even Shakespeare's (early) modern English is difficult for many.