var conditions = {
firstCame : !( localStorage.getItem('firstCame') || localStorage.setItem("firstCame", true) );
timeGap : Date.now() + 3e5; //3e5 = 300000 = 1000 * 60 * 5, т.е 5 минут
}
......
if(conditions.firstCame && Date.now() >= conditions.timeGap){
//Что-то делаем
}
......
var timeGap = false;
setTimeout(function(){ timeGap = true; }, 3e5);
......
if(timeGap){ ... }
......