Kile is able to distinguish code (and text) that's commented, whether with a percentage sign or within a {comment} environment. This functionality should also be usable when searching, to avoid matches which are commented - if the user has marked a checkbox saying s/he wants this. This is related to bug 377334 (Ignore folded fragments of code when doing search), but I believe should be of higher priority.