This question needs a long answer but I want from you a short answer on one aspect. Are all illnesses of heart caused exclusively by sins alone and nothing else or not necessarily? Example: Iblis got the illnes of pride because he thought he was the greatest general of all time. A sinless individual is praised a lot and he gets the illness of heart of thinking he is better than the others.
It can be caused by both sins and wrongful thoughts as you mentioned. Generally there are three factors that contribute to our inner state:
- Physiological/neurological traits and conditions*
- Thoughts including our worldview and self-image
It is proven in neuroscience that brain conditions influence our moral attitude towards life and others in general. Brain conditions associated with depression result in attitudes that are considered unethical in Islam such as cynicism, hatred and anger. People with prolonged depression may make openly blasphemous remarks in protest to their perceived abandonment by God. Such people may be said to have an ill heart (or brain?) but they deserve pity compared to say Iblis whose rebellion against Allah was rooted in his wrongful judgement and arrogance resulting from that rather than an unwanted health problem.
Deeds also influence our psyche as their effects consolidate in our being. A person committing sin would be more open to it next time. He would be more open to others doing sins. Because his inner state, his mind and maybe even physiology have been altered by sins. Again cognitive scientists have proven the impact of certain sins on our natural being such as drinking.**
The impact of thoughts are also obvious. Whatever you think of yourself and others influence your attitude and deeds. Think high of yourself (for whatever reason) you may look down on others, or feel less motive for greater progress, but also feel more confident. Think low of yourself, you may lack in courage, and self-esteem but be more open to good counsel, faith and submission to Allah. But best is to combine self-esteem with humility when it is due, or courage when it is necessary with fear of Allah, or pride in your religion but regret when found in error. So a lot depends on context.
*Some random scientific literature:
- Neural Correlates of Moral Evaluation and Psychopathic Traits in Male Multi-Problem Young Adults
- Serotonin selectively influences moral judgment and behavior through effects on harm aversion
- Personality traits linked to differences in brain structure