You could use use the ExistsDir InstallScript function to test for the existence of the directory and then set the output of this function to an MSI property using MsiSetProperty. Finally, this MSI property can be used as the condition of your custom action. Both of these functions are documented in the AdminStudio Help and these articles are also posted online at the following links:
Unfortunately, there is no property defined by MSI for that purpose. Please refer to Property Reference for a complete list of properties. You will have to define a property and run a custom action to set the property.
I think the System Search view would appropriate here. You can set up a search to look for a folder, if it is there set a property and then use that as a condition.