Well this is interesting. I found the source of the flicker. However, it doesn't make much sense, and is possibly a bug.
The paintbox that the shape was drawn over had a function tied to OnMouseLeave, which was supposed to hide the shape. For some reason, this function was called every other pixel that the mouse traveled. Unless I don't understand "OnMouseLeave", this shouldn't be the case, should it?