The automatic Divine Plea can cast under these conditions:
+ You have Divine Shield (immune to dispel)
+ Or you have at least 3+ buff on you (hand of freedom, kings, divine favor... the more buff on you, the less chance Divine Plea got dispelled)
+ Or there are no warlock pet felhunter
Focus the condition on these 3 possibilities

The conditions don't really affect the performance, cause the data is already stored in the objectmanager and doesn't need to be updated, so the conditions (yours or mines) shouldn't take more then 2ms.
The problem ist the CanCast-Method!
If u write it this way
PHP:
if(ConditionOne && CanCast) { Cast("Divine Plea")}
if(ConditionTwo && CanCast) { Cast("Divine Plea")}
if(ConditionThree && CanCast) { Cast("Divine Plea")}
u'll waste some milliseconds
if u write
PHP:
if((ConditionOne || ConditionTwo || ConditionThre) && CanCast){ Cast("Divine Plea")}
u won't waste these miliseconds, cause u only check once if u can cast the spell (no need to check if on cooldown, this should be checked internally in CanCast from SpellManager)
The condition for the HP of u and your teammate doesn't matter, u need to think proactive

if your low on mana, u'll need mana, so u have two ways of getting mana back ....
- get out of fight (very hard in 2vs2)
- mana cd from you and/or your mate
mayebe cyclone (or if a druid exists) should be checked too
But the dispelling isn't necessary ... fire Divine Plea

one or two ticks are better than nothing!
you can define a private bool which checks every condition and returns a true to keep the code a little bit cleaner
somethink like
PHP:
private bool shouldDP
{
get
{
if(DivineShieldisUP) return true; //found? exit here
if(!FelHunterOnMe && !DruidInRange || !(DispellerLoS && !ManyBuffs)) return true; //found? exit here
return Me.ManaPercent<=40?true:false;
}
}