potential main error point = while(condition) { wait(1); } loop in event function, on_server_event.
Some guesswork:
Code:
function on_server_event(void* str,var id) {
	if (event_type == EVENT_STRING)  {
		// temp2_str indicates a terminating sequence?
		if (str == temp2_str	
		&& (str_cmpni(temp1_str, "default") == 0)) {	
			var acchandle = file_open_write("new.txt");
			file_str_write(acchandle,temp1_str);
			file_str_write(acchandle,temp2_str);
			file_close (acchandle);
		}
	}
}