hmm. Just ran those npi's and w/ the following results (from the log):

4003 data _null_; length npi $ 10;
4004 npi='1003802901' ; valid_npi=isvalidnpi(npi); put npi valid_npi ;
4005 npi='1003864232' ; valid_npi=isvalidnpi(npi); put npi valid_npi ;
4006 npi='1013955343' ; valid_npi=isvalidnpi(npi); put npi valid_npi ;
4007 npi='1134108814' ; valid_npi=isvalidnpi(npi); put npi valid_npi ;
4008 npi='0000000000' ; valid_npi=isvalidnpi(npi); put npi valid_npi ;
4009 npi='1234567890' ; valid_npi=isvalidnpi(npi); put npi valid_npi ;
4010 npi='15280060' ; valid_npi=isvalidnpi(npi); put npi valid_npi ;
4011 npi='152' ; valid_npi=isvalidnpi(npi); put npi valid_npi ;
4012 npi='10038029O1' ; valid_npi=isvalidnpi(npi); put npi valid_npi ;
4013 run;

1003802901 1
1003864232 1
1013955343 1
1134108814 1
0000000000 0
1234567890 0
15280060 0
152 0
10038029O1 0
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
cpu time 0.04 seconds

You sure you compiled the function as written?