How do write code to a standard button before execution?

SUGGESTED

Hi, 

There is something wrong with my code and I am not sure what is wrong with it. The E represents the standard button, save, code for the screen. 

Thanks!

##########################################################

$AVANT_E

If [M:ALL]STA(nolign-1) = "A"
GMESSAGE="This product is in AR status!"
mkstat=2
Endif

Return

######################################################