Do you want to redirect the search engine spider to the pages that are for the public also, or do you want the spider to keep crawling the site that is being reconstructed?
To redirect the spider too, the simplest, best and most effective method is to repoint the domain name to the accessible site while work is being done. It only takes the same amount of time to change it back when work is complete so it doesn't 'knock the site out' any more than reconstruction will.
Alternately, simply include a meta tag refresh to the second site in the head of each page. Most spiders can detect, and some will follow, the refresh meta tag.
If you only want human visitors redirected (you don't fear broken links etc will affect your ranking for the site being rebuilt) then the best method is going to be cloaking.
A search for 'cloaking' will probably bring you up many of the commercial suppliers of the scripts you'll need. Look for a company that updates their spider IP address list regularly and reacts speedily.
Since your purpose is not to protect your code, virtually any method of cloaking will do, even purely user-agent detection based, but those based on IP address are often more reliable.