Almost all calls are like action to queue. What I mean is that it's not really a "return to server" as much as it is "do x in the next tick". If you have done programming like this before it's really second nature, but if you haven't it can be a bit confusing.
The best way to think of it is that each of the objects in the game have a action buffer. When you do stuff you write to that buffer, then finally then your ticks is done that buffer is executed. That's not totally accurate, but close enough.
So
var tick = function() {
spawner.bufffer = createCreep(1)
spawner.buffer = createCreep(2)
spawner.buffer = createCreep(3)
}
and the game engine calls tick() only createCreep(3) is actually there and actionable. That's basically what happens (again not totally accurate) on each tick. spawer.spawning can't be true yet because it hasn't started spawning yet. It doesn't start spawning till after the tick ends.
For a better example,
var amount = creep.carry.energy
creep.transfer(container, RESOURCE_ENERGY, 50)
amount === creep.carry.energy // will always be true because the energy is only queued to transfer.
all actions, only replace the queue and don't start till after the "tick"