I solved the file_dialog problem this way and it now works great.

#include <strio.c>

function loadgame()
{
wait(1);
video_switch(0,0,2);
char* filename = file_dialog("Load Saved Game","*.ssv");
video_switch(0,0,1);
var filehandle = file_open_read(filename);
...
}