Since this technique relies on moving a flashlight around in the dark, you have to experiment--and you won't get perfect results every time. Still, you can stack the deck in your favor by choosing your camera settings wisely.
Since the shutter needs to be open for so long, the only aspect of your camera that you can control is the aperture. If you use a small aperture (which equates to a large number like f/18), the effect of the light will be diminished. A large aperture (that is, a small number like f/4) will admit a lot more light, which means that any ambient light will illuminate the entire scene; however, it also means the flashlight's beam will appear brighter. Start with an intermediate aperture like f/8, and vary it to see how different values affect your photos.
Finally, the way you point your flashlight can produce dramatically different effects. I recommend pointing the flashlight directly into the camera lens, because that will give you the most immediate and dramatic result. But as an alternative, you could try shining the flashlight at objects in the scene instead. In a perfectly dark room, for example, you might experiment with selectively illuminating subjects.
For more ways to get in to the spirit of Halloween, see these items:
• Scary Fonts
• Halloween Games for the iPhone
• The 15 Freakiest Web Sites
• Costume Ideas - Halloween [iPhone app]