Ah! If I reflect right, sort my thoughts, catch them right when they come up and purify my thinking step by step by adding more good thoughts, chastising bad thoughts, gradually changing my thinking towards the wholesome and good, I act like the doorkeeper in the Buddha’s simile of sati. This doorkeeper promotes sense restraint. And sense restraint means I will not fall for unwholesome qualities of my mind which could break my sila which in due course would destroy my mental energy break up my concentration and destroy my efforts in building up wisdom. You translate sati as memory and sampajaññā as awareness. In the above steps of progression it fits in nicely, as memory is essential after listening to the Dhamma to remember and continously go over the “thoughts of the Dhamma” in this form of contemplative meditation. What was the simile of sati as the doorkeeper again?[The Buddha:] …”Similarly, o monks, just when there is a doorkeeper of a royal border-town, who is wise, smart, intelligent and who blocks those who he does not know and lets those proceed who he does know and who thus protects those inside and wards off those outside. In the same way, o monks, a noble disciple is remembering, is equipped with the highest carefulness and remembers things done a long time ago, spoken a long time ago, remembers in accordance. With memory as the doorkeeper, o monks, the noble disciple rejects the unwholesome and cultivates the wholesome. He rejects that which is with blemish and cultivates what is free of blemish, he always keeps himself pure.‘‘Seyyathāpi, bhikkhave, rañño paccantime nagare dovāriko hoti paṇḍito byatto medhāvī aññātānaṃ nivāretā ñātānaṃ pavesetā abbhantarānaṃ guttiyā bāhirānaṃ paṭighātāya. Evamevaṃ kho, bhikkhave, ariyasāvako satimā hoti paramena satinepakkena samannāgato cirakatampi cirabhāsitampi saritā anussaritā. Satidovāriko, bhikkhave, ariyasāvako akusalaṃ pajahati, kusalaṃ bhāveti; sāvajjaṃ pajahati, anavajjaṃ bhāveti; suddhaṃ attānaṃ pariharati. => AN, 10. Nagaropamasutta
... adding more good thoughts, chastising bad thoughts ...