This red-and-blue screen issue happened to me plenty of times, and I eventually figured out a fix. Here's the process: power on your DS, but before the Nintendo DS logo appears, press and hold Start + Select.
Then, as the Nintendo DS screen fades away and before the "not licensed or endorsed by Nintendo" message shows up, press and hold A + B while still holding Start + Select, so you're holding all four buttons at once.
After that, the screen fades and takes a bit longer to load as usual (it'll go white for about 10 seconds). Once it's done, you should be able to add your codes again.