Actually heart is a different word in both Hebrew and Greek than soul
H3820 לֵב leb (laɓe) n-m.
1. the heart.
G2588 καρδία kardia (kar-d̮iy'-a) n.
1. the heart.
It could also be translated... "For as he thinketh within himself."
That is synonymous with the function of the heart.
For that is where one thinks within himself.
Some simply choose to state what was taking place by using the word "heart."
Note please the process Lucifer deployed in his fall...
How art thou fallen from heaven, O day-star, son of the morning!
how art thou cut down to the ground, that didst lay low the nations!
And thou saidst in thy heart, I will ascend into heaven, I will exalt
my throne above the stars of God; and I will sit upon the mount of
congregation, in the uttermost parts of the north; I will ascend
above the heights of the clouds; I will make myself like the Most
High." Isaiah 14:12-14 ASV
No overt action.
Satan fell with a thought!
For, God sees our private thoughts as overt action.
“You have heard that our fathers were told, ‘Do not commit adultery.’
But I tell you that a man who even looks at a woman with the purpose
of lusting after her has already committed adultery with her in his heart."
Matthew 5:27-28
Complete Jewish Bible
We need to confess our mental attitude sins.
Not just our overt ones.
If we confess our sins, he is faithful and just and will forgive us our sins and purify us
from all unrighteousness. If we claim we have not sinned, we make him out to be a
liar and his word is not in us.
1 John 1:9-10
New International Version