So whilst playing a copy of soul silver on my DSI I ha this weird, glitch? So I just got back from the slowpoke well in azalea and when I was back at Kurt’s house the screen on my game started glitching like the edges would move In and out of place and make a sound, was this on purpose or something because I have no idea why it is doing that. I am going to upload a video of the glitch in the future...
It was on purpose.
If you happened to have a battle with wild/trainer Pokemons, and it made your Pokemon unhealthy, such as poisoning, sleepiness, paralyzed, etc, then it will shake. It will shake because your Pokemon is very ill and needs to go to a Poke Center or needs a potion,antidote,awakening, and etc, fast. OR, your game thing isn't fully inside the slot. It is Most likely to shake because of the battles.
The reason it is shaking, is because your Pokemon has a status condition. In gens 1-4 (specifically DPPt and HG/SS), the screen shakes when your Pokemon has a status.
Source and Xblade999's comment