You forgot to add you wait statement below your action in yor while loop.
You are not allowing anything else to run.
In loops, the wait statement is crucial.
You should really review the tutorials available on the download page, as this will really help with some of your scripting.

After this line:
my.pan += 10 * time_step;
Insert the following:
Wait(1);

Clay...


Wow! You have some major polygon issues there.