My additions

Mar 13, 2009 at 9:52 PM
In order to ensure items inside of subfolders also show up I added recursive scope to the view attributes for each of the SPQuery()s:

query1.ViewAttributes = "Scope=\"Recursive\"";

And also to improve performance with very large lists I added a RowLimit of 1000 since getting back a list of more than 1000 to choose from would sort of negate the usefulness of searching with the picker:

query1.RowLimit = 1000;

Lastly this should be deployed via a Solution Package, not with scripts. Here is a sample manifest to use:
<?xml version="1.0" encoding="utf-8" ?>
<Solution xmlns=""
          SolutionId="GUID HERE">
    <Assembly Location="MyDLL.dll"
        <SafeControl Namespace="MyNamespace.LookupWithPicker" Safe="True" TypeName="*" />
    <RootFile Location="TEMPLATE\XML\fldtypes_LookupWithPicker.xml" />
    <RootFile Location="TEMPLATE\CONTROLTEMPLATES\ControlTemplates_LookupWithPicker.ascx" />
    <RootFile Location="TEMPLATE\CONTROLTEMPLATES\LookupWithPicker.ascx"/>