if (value==0) 30 else value
Any time the value hits zero it will be reset to 30, or whatever number you want, if it is not 0 as in reset then the value will what the slider is set to.
It might be better to think about creating an animation preset, or several of them. I have about 200 dedicated to animating motion that I use almost every day and only about a half dozen rely on keyframes. The rest use the in and out points of a layer to activate motion. Most of them have sliders and check boxes that control timing. Here is an example of an animation preset that adds sliders to a layer, makes the layer fly in from the left, bounce to a stop, then fall out of the frame based on the in and out point. If you position the layer in it's "here" (resting) position, set the in and out point, then add the animation preset your work is done on that layer. This makes things like dynamic text animation a snap. Here's the preset: Dropbox - flyInBounceDropOut.ffx
Here's the expression:
sif = effect("slideIn Frames")("Slider");
sof= effect("slideOut Frames")("Slider");
// find in and out point
inTime = sif * thisComp.frameDuration;
if (effect("Match SI SO")("Checkbox") == 0) {
outTime = sof * thisComp.frameDuration;
}
else if (effect("Match SI SO")("Checkbox") == 1) {
outTime = inTime;
}
// Fix layer size when scaled
sf = scale - [100, 100];
xSize = width + (width * sf[0]/100);
ySize = height + (height * sf[1]/100);
realSize = [xSize, ySize];
// Set Positions
spx = 0 - realSize[0] + realSize[0]/2 ;
rstx = value [0];
rsty = value[1];
epy = thisComp.height + realSize[1] - realSize[1]/2;
// create movement
freq = effect("bounce Frequency")("Slider");
amplitude = effect("bounce Amplitude")("Slider");
decay = effect("bounce Decay")("Slider");
posCos = Math.abs(Math.cos(freq*time*2*Math.PI));
nt = time-inPoint;
y = amplitude*posCos/Math.exp(decay*nt);
moveIn = Math.min(linear(time,inPoint,inPoint + inTime,spx ,rstx-y));
moveOut = Math.min(easeIn(time,outPoint - outTime,outPoint - thisComp.frameDuration,rsty ,epy));
[moveIn, moveOut]
It's a good idea to put your custom expressions in a shared Dropbox folder or shared cloud folder and then create an alias to them in the standard folder for your custom shortcuts so they are available on any machine you use at any time and so you can browse them in the effects and presets panel.