Ok now i find a right way to use the functions, I used cron() instead of time().
The working script is following:
while(true){
//every day at 8:30am
cron("0 30 8 * * ?",true);
con = hasConnectivity();
if (!con) {
enableAirplane(false);
alert("Airplane Mode off",false);
}
}