How can I create a script that runs continuously but does not block the interface?
What you are looking for is to create a modal operator. From the Wiki:


  A modal operator defines a Operator.modal function which running,
  handling events until it returns {'FINISHED'} or {'CANCELLED'}. Grab,
  Rotate, Scale and Fly-Mode are examples of modal operators. They are
  especially useful for interactive tools, your operator can have its
  own state where keys toggle options as the operator runs.


There is a template for the Modal Operator accessible from the Blender Text Editor.