By Rabbi Avraham Moeinzadeh:
ואם לא תיטיב לפתח חטאת רובץ
“If you don’t do good the sin is lying by the door.”
Rabbi Gifter writes in the name of Hagaon MeVilna that the yetzer hara cannot deceive a person unless he finds an emptiness in the heart of that person, or at least if the person is doing mitzvot but not a hundred percent for the sake of Hashem. In that case, once the person has an ulterior motive for doing the mitzvot, it causes the yetzer hara to find his way into his heart.
Chachamim compare the yetzer hara to the fly that is sitting between the two chambers of heart. In this analogy Chachamim are trying to tell us that uncertainty (between the two chambers of the heart) is the only area in which the yetzer hara can thrive. With this introduction, Rabbi Gifter gives the explanation of the pasuk above. The sin is lying on any opening that can be found in the emuna of the person and the only remedy to that is to do good with certainty.