If your drive was throwing bad sector errors then data for Avast may have been affected, when Data Lifeguard Diagnostic moved the sectors containing those Avast files, to a known good sector(s).
I'd be more concerned about the actual condition of your hard drive and whether it is about to fail and give up the ghost than I would about whether Avast worked or not, given the conditions and circumstances you've described.
Hard drives are known to fail, but most give some sort of warning, such as a program not working properly, before they do so.
I'd run a complete WD Data Lifeguard Diagnostic check to ensure the drive is in good condition. All defragging does is move all files so they are more like contiguous and put together rather than scattered about the entire drive as separate pieces.