As Kalveo mentioned you cannot have a delay() inside an interrupt routine to create a delay.
Secondly the serial communication uses interrupts which, as CrossRoads mentioned : are disabled inside interrupt routine by default. You can enable them using sei(),but be careful it would also enable the interrupt for which the ISR itself is written for. So you have to disable the external interrupt first then enable global interrupts and after your operation enable the external interrupt once again.(you have to do these inside ISR. Its a little complex)
And to create the delay either you have to write it inside the loop() like below
void loop()
{
if(flag==1)
{
cli();//clear global interrupt flag
if (dim > 48 && dim < 53) {
delayMicroseconds(34*(255-state));
digitalWrite(AC_pin, HIGH);
delayMicroseconds(500);
digitalWrite(AC_pin, LOW);
}
flag=0;
sei();//enable global interrupt flag
}
}
or you have to create delay by giving the CPU to do something(counting from a large number till zero or vice versa) but you may not get accurate delay.
And finally you have not declared the dim variable as 'volatile'. This is necessary,since it gets modified inside ISR.
What is the maximum frequency of the zero crossing dimmer? may be you need not do all this(enabling and disabling interrupts), if the frequency is low and predictable.