basically what you want to do is calling an event everytime a tab is selected, except when its tab4, ie.:
when your tabs header looks somehow like this
<div id="tabs">
<ul id="tablinks">
<li><a id="tab1" href="#tabs-1">First</a></li>
<li><a id="tab2" href="#tabs-2">Second</a></li>
<li><a id="tab3" href="#tabs-3">Third</a></li>
<li><a id="tab4" href="#tabs-4">Fourth</a></li>
</ul>
<div id="tabs-1"></div>
<div id="tabs-2"></div>
<div id="tabs-3"></div>
<div id="tabs-4"></div>
</div>
then you attach a click event on every a tag in the "tablinks" unordered list, that has not "tab4" as an id:
$('#tablinks a[id!=tab4]').click(function(e){
//stoping timers or whatever
});
and concerning your second questions, the link you provided actually holds the answer to it..
when you create a timer by using "everyTime" or "oneTime" you can pass a label as a parameter, so that you're able to stop your timers whenever you want with the "stopTime" method, ie.:
$(document).everyTime(1000, "doingSomething", function() {
// NOTE: "doingSomething" is the label of this timer
// make an annoying bleep sound or whatever
});
now stop this timer by calling
$(document).stopTime("doingSomething");