We might consider the other meaning that God gives to the word "sin", in that it stands for the literal sin offering of the animal sacrifice, which is how Young's translates this verse.
"Is there not, if thou dost well, acceptance? and if thou dost not well, at the opening a sin-offering is crouching, and unto thee its desire, and thou rulest over it.'" (Gen. 4:7, YLT)
The same meaning is seen in Dan. 9:24 -
"...and to seal up sins,..." (YLT), or
"...and to make an end of sins,..." (KJV)
where Christ's sacrifice would be the end of the animal sin offering sacrifices.
In other words, the animal became sin, taking on the substitution or replacement on the altar for the human sinner. When the animal was brought before the priest at the altar, and the man laid his hand upon the head of the lamb (et al), the sin was considered to be transferred to the animal. Thus, "sin crouching at the door" could very well mean the animal sin offering was literally crouching at the door or gate to the garden.
In that case, God was telling Cain a double meaning: 1)that He had made another provision for the proper animal sacrifice that He had told both Cain and Abel to offer by sending an animal to wait at the door of the garden, and 2) that the spiritual affect of sin waits to overpower if Cain gave into that temptation (Rom. 6:12).
As God had given mankind dominion and rule over the animal kingdom (Gen. 2:26), then Cain was being told that he had dominion over the animal that waited at the door to be sacrificed, and at the same time to spiritually maintain control over the temptations to fall away from God's will.
Cain could have made a bargain with Abel to trade his crops for an animal to offer, but his pride got in the way. The temptation over powered him, and he did not master it, and did not obey the command to obtain and offer the correct sacrifice God had instructed.
Excerpt from Jamieson-Fausset-Brown Commentary on Gen. 4:7 -
"sin lieth at the door—sin, that is, a sin offering—a common meaning of the word in Scripture (as in Ho 4:8; 2Co 5:21; Heb 9:28). The purport of the divine rebuke to Cain was this, "Why art thou angry, as if unjustly treated? If thou doest well (that is, wert innocent and sinless) a thank offering would have been accepted as a token of thy dependence as a creature. But as thou doest not well (that is, art a sinner), a sin offering is necessary, by bringing which thou wouldest have met with acceptance and retained the honors of thy birthright." This language implies that previous instructions had been given as to the mode of worship; Abel offered through faith (Heb 11:4).
unto thee shall be his desire—The high distinction conferred by priority of birth is described (Ge 27:29); and it was Cain's conviction, that this honor had been withdrawn from him, by the rejection of his sacrifice, and conferred on his younger brother—hence the secret flame of jealousy, which kindled into a settled hatred and fell revenge." (Source: Biblehub)