AC Energy Meter calculation using ACS712

Yea, I think you may get better accuracy, close to 3-5 % error if running >1000 samples per seconds. Another drawback in the code, that magnitude calculated based on peak-to-peak value, and it's good for RESISTIVE load only. Do your research
on RMS measurements. There are many arduino projects, energy monitoring etc.