Should work correctly. From is_dir() documentation:
Returns TRUE if the filename exists
and is a directory, FALSE
otherwise.
Well, anyway if it doesn't try this:
if(file_exists($dir) && is_dir($dir))
BTW. results of these functions are cached in stat cache. Use clearstatcache() to clean that cache.