Here's my latest script:
It's basically a Scale2X-algorithm, but modified to work better with 24-bit RGB images. The original Scale2X algorithm has the problem that it only works well with indexed bitmaps, as it compares each pixel to it's neighbours with simple == or != operators.
So I added in a treshold setting, now pixels are considered the "same" if their difference doesn't go above the difference treshold. Basically, the more colourful the image, the higher the treshold setting should be. It may take some trial and error to find the optimal setting.
The algorithm still works best for computer-generated bitmap images, and not so good for photos. Not only because of quality, but also because it's kind of slow - larger images take a very long time. I've tried to optimize it but it's still kinda slow... I may try to optimize it further in the future.
For now, it's a pretty good plugin for resizing smallish bitmaps eg. icons, sprites and such.