Either posting the error message or the entire code is a good idea. Sometimes a missing bracket or semicolon near the top can ruin everything.
And there seems to be a random apostrophe or single quotation mark in the while loop.
Lastly, I'm just being nitpicky here, but this part
let y = 0;
while(y<10){
CreateShotA(01,GetEnemyX+20*cos(dir),GetEnemyY+20*sin(dir),0);
SetShotDataA(01,0,6,dir,-0.2,-2,1,RED09);
FireShot(01);
CreateShotA(02,GetEnemyX+20*cos(dir),GetEnemyY+20*sin(dir),5);
SetShotDataA(02,0,6,dir,0.2,-1,4.5,RED09);
FireShot(02);
wait(5);
dir+=360/36;
y++;
}
y = 0;
could easily be replaced by
loop(10){
CreateShotA(01,GetEnemyX+20*cos(dir),GetEnemyY+20*sin(dir),0);
SetShotDataA(01,0,6,dir,-0.2,-2,1,RED09);
FireShot(01);
CreateShotA(02,GetEnemyX+20*cos(dir),GetEnemyY+20*sin(dir),5);
SetShotDataA(02,0,6,dir,0.2,-1,4.5,RED09);
FireShot(02);
wait(5);
dir+=360/36;
}