Is the Anacoluthon grammatical?
This is an old question, and it is not by any mean just restricted to Spanish. In general, an anacoluthon happens when a phrase is "out of the sentence," that is, when somebody starts a sentence in a way that leads us to expect certain grammatical resolution, but it concludes in a way that is not consistent with this expectation. It is far more common in the spoken language. Take for instance, this example from Silva Rhetoricae:
(1) Athletes convicted of drug-related crimes—are they to be forgiven with just a slap on the wrist?
The first phrase Athletes convicted of drug-related crimes is not part of the whole sentence from a strictly grammatical point of view; it does not have a syntactic function, it is not the subject or the object, or anything like that. Now, an anacoluthon like (1) is actually a rethoric figure, and probably the same happens with its corresponding Spanish version (2):
(2) Atletas condenados por crimes relacionados con las drogas—los debemos perdonar con solo una palmada en el trasero?
Although the anacoluthon is heavily condemned by the prescriptive discourse, it is likely that even a hard-to-die prescriptivist had difficulties banning (2). Many other anacolutha are not so lucky. For instance, these expressions are be considered unappropiate:
(3) El ventero, que no conocía a don Quijote, tan admirado le tenían sus locuras como su liberalidad
(4) Las pastoras de quien hemos de ser amantes, como entre peras podremos escoger sus nombres
(5) Dio orden a todos sus criados del modo que habían de tratar a don Quijote, el cual, como llegó con la Duquesa a las puertas del castillo, al instante salieron dél dos lacayos
All of them, however, come from Don Quixote, the most praised literary work in the Spanish language, and a novel that it is usually presented as a model for good writing by the prescritivists.
The interesting question, that I do not solve here, is what exactly licenses the anacoluthon, and what is its relation with the subsequent sentence. Is it part of the sentence? Is it part of its syntactic structure? If it is not, how does it enters into its informational structure?