To enable debug mode first unlock the sound test via special stage time trials, when in the sound test enter PCM 12 DA 11 and a picture of tails will pop up. After this simply press any button to return to the main menu and start a game and you'll be in debug mode (Debug mode only works in the normal game and stage select, if you play a level in time trial mode Debug will be disabled and you will have to re-enable it). Controls for debug are as follows, Circle: Enable/Disable item mode, Square/Triangle: Place object while in item mode, X: Cycle through objects while in item mode.
Stand waiting for a few seconds, and Sonic will grow impatient. Wait for 3 minutes and Sonic will shout "I'm outta here!" at you and fall off screen for an automatic game over.
Entering the following numbers in the Sound Test to access these messages (You will need Sound test Unlocked in Extras): (Codes work with both Japanese and American sound tracks)
In Time Trial mode having your total time under a certain amount will unlock the following extra modes.