No idea about the cheat code.
One thing you can do is use save states to save your game and then load that when needed.
The way I did was to only make a save when each level started, to give me unlimited continues, but still get the experience of playing the original game. I would also set a threshold of allowing 2-3 deaths (depending on how many lives I have left) before loading the save.
I did cheated on this a couple of times when I got stuck, but that's a separate topic.