There is a principal of "devarim shebichtav iy atah rashai le'omram b'al peh" - Torah that is written is not permitted to retell purely from memory. It is for this reason we do not permit the bal koreh to read "from memory" even when they have the entirety of the laining memorized. This may have significant halachic ramifications especially regarding the parts of davening (Shirat HaYam, Shema, mussaf additions, etc.) where we recite whole perakim from the torah, often from the heart.
The converse also holds - as a principal we generally don't commit to writing Torah sheb'al peh, to the extent that the tana'im would write their own notes but would not distribute them! Later it was decreed that in order to preserve knowledge of tradition (eis la'asos hashem, heferu torasecha) they permitted the codification of the mishnah and later the Talmud.
There are opinions who consider the buying of a sefer (and certainly publishing your own) to be a fulfillment of the mitzvah of ketivat sefer torah. (Shulchan Aruch YD 270:2)
Do we consider Divrei Torah explaining the pshat of a possuk (like Rashi) to fall under the latter category, by which one is impelled to teach torah (udelo yalif katala chayiv), but not necessarily to write it?
Or, since it is torah solely derived from Torah shebichtav, does it have the status of Torah shebichtav (and may fulfill the requirement to make a Torah shebichtav) and, consequently, one would potentially be required to commit it to writing?