You can use a windows program called R4CCE to edit the usrcheat.dat file! it's located in "sd:/_nds/TWiLightMenu/extras/". Open usrcheat.dat in r4cce, add a new game, and under Game ID click the ellipses button and select your patched nds rom (make sure its the same exact rom you have on your DS! Game ID's change whenever the rom is patched). Once you add the game, click "Add Code" to add codes to the list, name the code, and paste your code in the Code List. When you're done, move usrcheat.dat back to your DS, and the codes should show up in twilight menu.
Keep in mind some codes either will not work or crash the game because some memory addresses change when the rom is patched, so make sure to backup your save data before doing anything!