The crash is caused by the infinite loop working. The game will hang until the script function call is finished - which obviously won't happen if you are stuck in an infinite loop. I am assuming you want some form of event which is fired once per step, in which case, try the following:
void OnStart()
{
loopStep("LoopTimer1");
}
//Loop the specified timer with delay of fDelay
const float fDelay = 1.0f / 60.0f; //60 steps per second
void loopStep(string &in asTimer) {
OnStep(asTimer);
AddTimer(asTimer,fDelay,"loopStep");
}
//Our loopStep code will call this once per step.
void OnStep(string &in asTimer)
{
//CODE HERE
}