If the goal is to have InvokeRepeating use a different length of time whenever it repeats, then no, that’s not possible using InvokeRepeating. Instead you can use a coroutine. (But not like your second example, which can’t work since Update can never be a coroutine. Just leave Update out of it and use a coroutine.)
I figured out what I was trying to accomplish: random generation of a number once every X seconds, for decision making.
Heres the code:
var rand;
function Start()
{
InvokeRepeating("RandomRanger", 0, 1.5);
//sets function to repeat once every 1.5 seconds starting immediately
}
function RandomRanger()
{
var it = Random.Range(1, 5);
rand = it;
//makes random number
}
function Update(){
print (rand);
}