Make it official. Grant him/her a number of hours (of course on his/her own expense) per day. Developers that have projects of their own are usually the best ones.
An alternative is to hire him/her as a freelancer. Will cost a bit more, but all invoiced hours will be truly productive. I work in a construction like that myself. Doing the same thing each and every day the whole day is just to much for me. Diversity in my work keeps me productive.
Working hours can be checked, output quality is much harder to check.
Having said this all, workers should be honest. Working on private project in company hours without agreement on this is unacceptable. Trust is a requirement for any work relationship.
J. de Hooge
www.transcrypt.org