You don't even need the 'smartStats' temporary file at all, since you can do that with just one grep:
smartctl -a /dev/sda |
grep '\(Reallocated_Sector_Ct\|Current_Pending_Sector\|Offline_Uncorrectable\|UDMA_CRC_Error_Count\)' > /root/stats