The only way to set a function like an addon not being present in combat would be for the author to code that. Even if you knew LUA coding well, adding something like that to an addon could potentially break it.
What you could do, though, is use an in-game addon manager. Curse has a few of them. I'm not really sure which is the best, as I don't use them.
It's not the most elegant solution; but you could go in and turn off an addon while you're raiding, then turn it back on when you're done. It's a little bit of extra tedium, but it would work.
You can't sleep() but it may be possible to find it's alter functions (onUpdate/eventHandlers).
1. Have a single variable that tracks "last did work at time".\
2. Whenever you enter an event handler GetTime() to figure out what time it is now.
3. if the time now minus "last time you did work at" is > (some amount of time) then
3 a. 1. update "last did work at time" variable
3 b. 2. Do the rest of the standard trigger/update code
4. else, do nothing.
GetTime can throttle but you could of course add in zone checks, group size counts, class/character/spec checks, etc. You'll never completely remove CPU consumption because you'll always need to checking if it's time to do 'the real work'. Further, you're not going to gain anything unless the 'real work' you avoid doing is significantly more expensive than the cost of the 'should I do some work now' check.
The problem is that this sort of thing can 'break' addons or make them perform unexpectedly. For example, if you've got a damage meter where you try to plug in code like that then it's going to miss almost all of the data so it will become useless. You'll also slow down things like updates so animations will run less smoothly.
Just because an addon is loaded doesn't mean it's actually doing anything. If you've been collecting data with auctioneer and then bugger off to a raid, auctioneer doesn't actually do anything while you're in the raid. None of the events that would cause auctioneer to 'do stuff' can be fired in a raid so it has as much impact on your frame rate as if it had been disabled. The way addons are written - they should be 'dormant' unless there's a reason for them to be doing work. Things that display how much gold you have only update when your gold count changes - it takes (effectively) zero effort to keep displaying something that doesn't change and no code runs while your gold count is static.
I suspect you'll discover after profiling your addons you'll discover that few if any would be 'improved' by this sort of trickery.
You can make a macro in game or make a button in Lua that will disable/enable the addon and reload your UI. But there's not really anything you can do to make it automatic unless you dig deep into its code and alter it.