The most strightforward way is to use JS block for this task. You can check whether your ad is visible. To achieve that you can use different JS expressions and different logic.
For example:
1) check height and width of ur ad is not 0.
2) Wrap your ad in some block and then check if it's visible -
document.getElementById("<id_of_the_wrapper>"))["display"] == "none"