First of all, if you are going to use goto, it has to be contained in a function or action. goto is used in a function to go from one line to a label. goto also is rarely recommended for use.

Second of all, I don't think a panel can be declared in a function

The way this would be done is, declare the two panels, then in a function, set the VISIBLE flag when you need them.

Code:
PANEL* tartbildschrim = // first panel (800x600)
{
   pos_x = 0;
   pos_y = 0;
   layer = 1;
   bmap = Startbildschirm;
   flags = OVERLAY | VISIBLE;
}

PANEL* zweitesbild = // this panel should cover the first panel after 5 seconds. But it doesn´t work.

{
   pos_x = 0;
   pos_y = 0;
   layer = 3;
   bmap = schriftzug;
   flags = OVERLAY;

}

function switchPanels()
{
   wait(-5);  //wait 5 seconds
   set(zweitesbild,VISIBLE);      //turn on the second panel
   reset(tartbildschrim,VISIBLE);  //turn off the first panel
}



I was once Anonymous_Alcoholic.

Code Breakpoint;