Begin
If valid_deptno(10) then
dbms_output.put_line('True');
else
dbms_output.put_line('false');
end if;
end;

above syntax could be used for your function, which returns a boolean.
If valid_deptno(10) then
or
If not valid_deptno(10) then -> to check for -return false value

hope it helps
bye
murugs