The IPU works automatically, always.
When you change the video mode and request any resolution, the IPU always scales the screen.
screen = SDL_SetVideoMode(160, 102, 16, SDL_HWSURFACE | SDL_DOUBLEBUF);
Here i requested the screen resolution to be 160x102. Then, the IPU will automatically scale it to fill the GCW's 320x240 screen (keeping the aspect ratio). No need to do anything else, other than blitting the appropiate (160x102) images/areas to the screen (because at this point we are working at 160x102, not at 320x240).
Of course, if i do this:
screen = SDL_SetVideoMode(320, 240, 16, SDL_HWSURFACE | SDL_DOUBLEBUF);then, no scaling will be applied because 320x240 is the same resolution as GCW's 320x240 screen.
In your case, it seems that, after returning to 320x240 mode, you are still blitting a smaller 160x102 area to your screen surface. You probably made a SDL_Rect with x=160 and y=102 for blitting into the smaller screen surface, and you forgot that, after returning to 320x240, you should return to a 320x240-sized SDL_Rect.
The /sys/devices/platform/jz-lcd.0/allow_downscaling setting is not needed for your emulator. That's only needed for apps which work at a higher resolution than 320x240. Handy only changes to lower resolutions, so that is not needed at all.