Nothing wrong with the code as far as I can see, maybe somewhere else in your code is something wrong. Try to run it in FireFox with firebug or with Chrome (no plugin needed) press F12 and check out the console.
function checkHourBetween (hourOne, hourTwo)
{
var date = new Date();
var currentHour = date.getHours();
console.log("currenthour is:",currentHour);
console.log("hourOne is:",hourOne);
console.log("hourTwo is:",hourTwo);
if (currentHour >= hourOne && currentHour <= hourTwo)
{
console.log("returning true");
return true;
}
console.log("returning false");
return false;
}