Yes, manually processing all the pixels is always slow. However, you could change the resolution to 320x240 (and replace all fixed ocurrences of "640" and "480" in code by a variable, since now they are hard-coded) and processing will decrease to 1/4th of the current time or less. I am sure that the camera will still detect the laser beam, since sensors are not so fine-grained.
Once you have it working and feel comfortable with it you could jump to OpenCV. All this can be done with just a few lines of code (but also means learning the new syntax)