A The Following explanations due to the BDL are the clue to your question.
L’imparfait narratif (aussi appelé imparfait historique ou pittoresque) évoque un fait qui a eu lieu à un moment précis du passé, moment explicité dans la phrase par un complément. Cette façon d’évoquer un événement a un effet dramatique, car le fait passé est présenté comme s’il était en cours. La part d’inaccompli de l’action qu’implique l’imparfait permet d’évoquer implicitement les conséquences qu’entraînera cette action, ce que ne ferait pas le passé simple (ou le passé composé), forme habituelle dans de tels contextes.
Exemples :
Le 8 avril 1995, Marcel épousait Fabienne.
Il a commencé à travailler le 5 janvier. Une semaine plus tard, il démissionnait.
The explanations below is mine, as inspired by those formulated by the BDL;
The "imparfait narratif" also called "imparfait de narration", more absolutely "imparfait historique" and accessorily "imparfait pittoresque" refers to an action that took place at a point in time in the past; the precise time is made explicit in the sentence through the use of a complemen. The intent in this use of the "imparfait" is to confer to the event the nature of a dramatic or solemn and in any case important happening; sometimes, associated to this use (instead of the expected "passé simple" or "passé composé") is the idea, related to the importance conferred, that the action is one that will have consequences of much import.
The following remarks are useful; they are reproduced below;
- En 1815, Napoléon partait pour Sainte-Hélène.
Ici, on pourrait remplacer l’imparfait par un passé simple. Mais avec l’imparfait, l’événement n’est pas anecdotique : il prend plus d’ampleur ; on donne de l’épaisseur à des procès qui, par nature, n’en ont pas.
In your example there is no complement and so the interpretation of "écrivait" must be enlarged; even if he did write that just once we have to think of as the essence of what he would write, possibly repeatedly in different ways. I see no other possible explanation, this use of the imperfect being that for actions that are continuing in the past.
B In the second case the "imparfait" is also the normal tense; it is not to be construed that Stendhal said just once or wrote just once "Le roman est un miroir que l'on promène le long d'un chemin."; he might have written that but once, however we must understand by "disait" that that was what he thought all the time, that what he would argue. Therefore there is no question of an action a point in time.
C The reasoning in matters of interpretation of the tenses has nothing to do with material in it being quoted.