The Hebrew Bible does not quite put things the way we did in ~1~, Yuri (vi&., something like “writing on the heart with vivifying words is the priority, external writings are only at best concessions for the sake of this”), but it is certainly easy to read it in this manner.
Though God may inscribe the Law with his own finger (Exod. 31:18), and though in the Priestly writings there are plenty of signs that the keeping of the commandments is the very substance of God’s dominion/kingdom, likening one to the angels (the Psalmist has similar ideas) , the Deuteronomic ideal is still that the Law will not primarily be “out there” in rules and regulations, but inscribed on the heart:
4 Hear, O Israel: The Lord is our God, the Lord alone. 5 You shall love the Lord your God with all your heart, and with all your soul, and with all your might. 6 Keep these words that I am commanding you today in your heart. 7 Recite them to your children and talk about them when you are at home and when you are away, when you lie down and when you rise. 8 Bind them as a sign on your hand, fix them as an emblem on your forehead, 9 and write them on the doorposts of your house and on your gates. (Deuteronomy 6:4-9, NRSV)
Now, I’m wary of assuming too much about what kind of anthropology is involved here (or what is meant by “love”), what “the heart” means to the Deuteronomist, and what “in [the] heart” would mean (it is almost certain that we instinctively project our modern model of interiority onto this and similar texts in anachronistic fashion). Nonetheless, it bears pointing out that the Deuteronomist writes that the commands are to be “in [the] heart[s]” of the Israelites before they are to be spoken about by them or written down by them — speaking and writing seem to be downstream to the ideal of the laws being “in [the] heart”. The same pattern is repeated in Deuteronomy 11:18-20.  I suspect that the ordering reflects the ideals reflected in them, are not accidental.
The same theme is elsewhere: in Psalm 40:8, the Psalmist writes about how the law “is within [his] heart”; in Psalm 119:11, God’s words are “stored up in [the Psalmist’s] heart”. In the Septuagint edition of Psalm 85:8, the Psalmist says that he
will hear what the Lord God will say concerning me: for he shall speak peace to his people, and to his saints, and to those that turn their heart toward him. (Brenton)
The heart, the vital center of the person, remains the key source for hearing divine speech, whatever that means. (–and would that God preserve yours in its purity, Yuri!)
In Proverbs, it is also the heart that is sensitive to the instruction of other human beings. There, the heart is explicitly likened to a tablet in 3:3, and commandments are “stored up” in the heart and written on that “tablet” in 7:3; In Proverbs 6:20-23, a very similar note to the Deuteronomic one above is issued, with a similar sequence  Proverbs 22:17-21 shows a very alloform sensibility, but without seemingly sharing an oral (or literary) form; the hearer who treasures the words of sages in his (or her) heart can also offer wise words to others.  Jeremiah 17:1, by contrast, represents what is written on the heart as being…not so good:
The sin of Judah is written with an iron pen; with a diamond point it is engraved on the tablet of their hearts, and on the horns of their altars (NRSV)
The cultic language about the heart also appears in the New Testament, in places like Hebrews 11:22 and so on, where the heart is “sprinkled”, which is cultic language drawn from the Hebrew Bible (from Exod. 29:4, Lev. 8:12, &c.).
Eschatological hope for this writing on the heart appears in Jeremiah, and in Ezekiel; these verses are key to the way that this theme is taken up by some of the writers who appear in the New Testament. 
The Hebrew Bible, as I understand it, does not parse out the heart and the mind in quite the way that Greco-Roman culture does in the wake of Plato and his successors. The “heart”, here, seems simply to be the source of life no less than thought, which is why Proverbs 4:23 has simply “Keep your heart with all diligence, / For out of it spring the issues of life.” (NKJV)
Nonetheless, all of these themes are taken up, in various ways, by the several authors whose works are gathered up into the New Testament. They also appear in several ascetically-minded patristic writers, such as St. Isaac the Syrian, and represent the Romantic understanding of the wellspring of a person’s thought and agency and connection to others in Dostoyevsky’s TBK.
It is for this reason I linger on this question of the heart with regard to writing, and am plodding through precedents to how the heart appears in TBK: I am convinced that TBK subordinates writings and the act of writing to questions about the heart, how it is affected, how it generates written documents, how it can serve as a medium to connect hearts, or else how it reinforces distance — and I am resolved to trace this for you, Yuri.
It may be that writing, in the Hebrew Bible, is at first a technology for overcoming the distance of time and space, for conquering it by the anchoring of memory. During the period of exile, the Israelites lacked most of the features that most of would generally recognize as necessary for making a people a people. There was no migration to a metropol (see Benedict Anderson), there was serious risk at losing the national language, and adopting the memories of the host culture; there was no governing apparatus or institutions; there was no temple. Mary Douglas has argued, in Leviticus as Literature, that the book of Leviticus is structured as a virtual walkthrough of the temple-as-tabernacle for those who cannot enter it physically — the text is a proxy. To be clear: the text is a substitute for these things that normally stabilize a people as a people. The stabilization of the text was key to this, and the serious study of it. Study of an external text in scrolls was not enough, however: the interiorization of the precepts are, as we see above, key.
So see Psalm 103:17ff. (here I give the KJV)
the mercy of the Lord is from everlasting to everlasting upon them that fear him,
and his righteousness unto children’s children;
18 to such as keep his covenant,
and to those that remember his commandments to do them.
19 The Lord hath prepared his throne in the heavens;
and his kingdom ruleth over all.
20 Bless the Lord, ye his angels,
that excel in strength, that do his commandments,
hearkening unto the voice of his word.
21 Bless ye the Lord, all ye his hosts;
ye ministers of his, that do his pleasure.
22 Bless the Lord, all his works in all places of his dominion:
bless the Lord, O my soul.
The dominion of God is manifest in the execution of his commandments or words; the angels/messengers do this; God’s people, Israel, insofar as they do the same, seem parallel to these messengers/angels. The commandments are often, in the Hebrew Bible, strongly associated with life, since they were understood to have their origins in the same place that life has its origin — God.
So Deuteronomy 11:18ff.:
18 You shall put these words of mine in your heart and soul, and you shall bind them as a sign on your hand, and fix them as an emblem on your forehead. 19 Teach them to your children, talking about them when you are at home and when you are away, when you lie down and when you rise. 20 Write them on the doorposts of your house and on your gates (NRSV)
So Proverbs 6:20-23
20 My child, keep your father’s commandment,
and do not forsake your mother’s teaching.
21 Bind them upon your heart always;
tie them around your neck.
22 When you walk, they will lead you;
when you lie down, they will watch over you;
and when you awake, they will talk with you.
23 For the commandment is a lamp and the teaching a light,
and the reproofs of discipline are the way of life, (NRSV)
These are not necessarily God’s commandments, but the point is similar. I have not looked at what the critical scholarship has said about the different social locations with regard to these similar phrases — they could be stock phrases in the ancient near east.
So Proverbs 22:17-21:
Incline your ear and hear the words of the wise,
And apply your heart to my knowledge;
18 For it is a pleasant thing if you keep them within you;
Let them all be fixed upon your lips,
19 So that your trust may be in the Lord;
I have instructed you today, even you.
20 Have I not written to you excellent things
Of counsels and knowledge,
21 That I may make you know the certainty of the words of truth,
That you may answer words of truth
To those who send to you?
Jeremiah 31:33-34. has
this is the covenant that I will make with the house of Israel after those days, says the Lord: I will put my law within them, and I will write it on their hearts; and I will be their God, and they shall be my people. 34 No longer shall they teach one another, or say to each other, “Know the Lord,” for they shall all know me, from the least of them to the greatest, says the Lord (NRSV)
Ezekiel 36:24ff. takes up this theme
I will take you from the nations, and gather you from all the countries, and bring you into your own land. 25 I will sprinkle clean water upon you, and you shall be clean from all your uncleannesses, and from all your idols I will cleanse you. 26 A new heart I will give you, and a new spirit I will put within you; and I will remove from your body the heart of stone and give you a heart of flesh. 27 I will put my spirit within you, and make you follow my statutes and be careful to observe my ordinances. (NRSV)
Header image is handwritten by Dostoyevsky himself regarding The Brothers Karamazov, and can be found here.