easier than that add to only k-rate as first line
if(!param_active) return;
(its not needed in s-rate, as the above terminates the dsp routine)
however, either, will leave any audio buffer, or other outlet in-initialised.
to do 'properly' , you would have to also (before this line) set outlets and audio buffer to what you expect. e.g. with an audio buffer this normally would be to copy the inlet to the outlet.
(obviously you would want to only do this when not active, so as not to impose the overhead when the object is active)
also be aware doing this, makes it quite possible you will possibly start encountering cpu overloads.
e.g. imagine you have lots of objects like this in a patch whilst 'testing' then in a live performance you turn them all on , if you have not tested before, you may suddenly find you don't have enough cpu for all objects... so this (like all conditional code in dsp), has to be 'handled with care', you should test your patch with ALL code active whilst testing.