To do this you have to find the id of the tab. The ids are like: tab0Tab, tab1Tab...in order of appearence in the form.
crmForm.GetTab($get('tab0', crmForm), true);
And after that to insert the function on the OnLoad event of the page.
And that's it all. After that when you'll press on the tab you selected in the function the form will be refreshed.