God wanted Cain to repent. To this very day, God is commanding every person to repent, turn to Him, and believe His Word. It means to change your thoughts and your actions. To repent is to agree with God that you have no possible way of saving yourself from His righteous judgment, and then to turn to Him and submit to His way of salvation. He buys a ticket and climbs aboard.
True repentance involves two actions.
First, you must turn from yourself, your sins, your idols and your self-efforts to gain God's favor. Then you must turn to God and His Word which tells you how to be saved. That is true repentance. As for Cain, he never repented. Cain chose to continue in his own way .