Intention matters... but so do the circumstances and the reason for the patur.
In the case of the Sukkah, we do not eat in the rain because it is unpleasant. If you find eating in the rain durringduring sukkot unpleasant, thanthen you should not eat in the sukkah even if you aren't eating even when it isn't raining. If, however, you normally don't eat in the Sukkah, and the rain inspires you to go ahead and duedo it (out of some desire for self sacrifice and it makes you feel good) then you should certainly take the opportunity to do Teshuva and eat in the sukkah in the Rain. But ofcourseof course you don't have to if it is indeed unpleasant for you.
In the case of the Tefilin, it makes no sense to not wear tefilin during Chol Hamoed if you don't wear it the rest of the year. The Mishna says you wear Tefilin, and only for Kabalistic reasons, does it make sense to remove them for Chol Hamoed. Not wearing them during Chol Homoed is just a great opportunity for your Yetzer Harah to convince you to not do teshuvah.
Source: College Rabbi who dealt with this issue often.