How about this instead?:
if { [db_0or1row "tsearch_compile_check" "select distinct typname from pg_type where typname='tsvector'"] } {
# if tsearch is installed ns_log Notice "******* Tsearch2 is compiled and installed. ***********" # continue with installation