Hey, that was quick :D
Surely when the second while finishes, LINECNT must be 319 (as it is no longer 0, it must have gone back up to 319?).
I only ask because it looks as if currently the VSync routine idles for a scanline longer than it needs to... you could draw another few sprites in...