When I understand correctly, such code causes too much overhead for your functions:
function out = calculate(in)
p_isdeployed = isdeployed();
Such code will be rather slow, if you repeatedly clear the persistent variable e.g. by a clear all or clear function. But if you omit such inefficient cleanups, the overhead should be very small. Except if the actual calculation is tiny, e.g. out = in + 1 and you call this function billions of times. In this case Joan Puig's suggestion is the only usable way: Either accept the overhead for testing the deploy-status inside the function, or use two different functions.
I'm using both methods for the equivalent case that code should run efficiently under Matlab 2009a and 6.5: If the functions are large and the overhead of testing can be neglected, I test the version by the fast C-Mex FEX: isMatlabVer:
if isMatlabVer('>=', 7, 9)
a = bsxfun(@plus, b, c)
a = b(:, ones(1, length(c)) + c;
If the overhead for testing the version would be too large (a rare case!), I create two functions, which are stored in different folders:
Then the function which initializes my toolboxes the matching folder is included in the path dynamically by addpath. Of course this methods will lead to an exploding complexity, if all other versions between 6.5 and 2012.b have to be considered, when this is implemented naively, but in your case you need only two folders: \myTools_deployed and \myTools_undeployed.