Magento ver. 1.9.0.0

I keep getting the BLOCK\_HTML cache becoming invalid and this is stopping some external blocks of code from displaying until I refresh the cache. I see that I can flush the cache in my code as follows:

```
Mage::app()->getCacheInstance()->cleanType('block_html');

```

I would like to call this only if the cache is invalid, is it possible to check if the cache in invalidated?

Many thanks