Because God had not accepted his offering or because He had accepted Abel's, Cain was angry and depressed. God tells him that if he changes his ways, he will indeed be accepted. But if he does not change, sin—pictured as a slave crouched just outside the door of his heart, awaiting the bidding of its master—would spring to action. God is describing sin's persistent nearness; it is always ready to extend its dominance by increasing iniquity. Sin strives to pile iniquity upon iniquity, even as one lie usually produces another to keep a façade of deception from crumbling.
God's warning is clear. Repent of sin at once, or it has a powerful tendency to grow and thoroughly dominate one who does nothing to stop it. This thought is reinforced in the final sentence of verse 7, "And its desire is for you, but you should rule over it."
In paraphrasing God's words, James G. Murphy in Barnes' Notes, gives an insightful comment:
Thy case will be no longer a heedless ignorance, and consequent dereliction of duty, but a willful overmastering of all that comes by sin, and an unavoidable going on from sin to sin, from inward to outward sin, or, in specific terms, from wrath to murder, and from disappointment to defiance, and so from unrighteousness to ungodliness. This is an awful picture of his fatal end, if he do [sic] not instantly retreat. ("Genesis," p. 151)
In modern terms, God is saying, "Practice makes perfect." Sin's desire is so persistent and its appeal so subtle that, if it is not consciously stopped, one will become a master, a "pro," as we would say today, at sinning. It becomes a way of life. Jeremiah 4:22 makes this principle even clearer. "For My people are foolish; they have not known Me. They are silly children and they have no understanding. They are wise to do evil, but to do good they have no knowledge."
Did not God's warning prove true in Cain's life? We cannot afford to ignore sin's pervasive influence.