I found this anonymous poem in The Oxford Book of Christian Verse edited by Lord David Cecil (London: Oxford University Press, 1940).
‘If I Could Shut the Gate’
If I could shut the gate against my thoughts
And keep out sorrow from this room within,
Or memory could cancel all the notes
Of my misdeeds, and I unthink my sin:
How free, how clear, how clean my soul should lie,
Discharged of such a loathsome company!
Or were there other rooms without my heart
That did not to my conscience join so near,
Where I might lodge the thoughts of sin apart
That I might not their clamorous crying hear,
What peace, what joy, what ease should I possess,
Freed from their horrors that my soul oppress!
But, O my Savior, Who my refuge art,
Let Thy dear mercies stand ‘twixt them and me,
And be the wall to separate my heart
So that I may at length repose me free;
That peace, and joy, and rest may be within,
And I remain divided from my sin.