Let the title screen fade out to the intro then press Start to go back to the title screen again. Repeat this 6 more times (you should have seen the title screen a total of 8 times) and at the 8th title screen, press and hold Up, Left, A, B and Select and press Start. If done right, you'll have 99 continues.
On Stage 6-2B, grab the 1-up, backtrack to 6-2A, then return to 6-2B. The 1-up will have reappeared, along with all other power-ups in the room. You can repeat this process until the timer runs out.
In Stage 7-2D, grab the 1-up, backtrack to 7-2C, then return to 7-2D. The 1-up will have reappeared, including all other power-ups in the room. Again, this can be done repeatedly until the timer runs out.