I have also had the same problem when using the powers settings. Also running Win98SE, except I don't have avast scanning. I just have the Blank Screen screensaver running. Rather than deal with the machine locking up I just set the power settings to Always On.
The power settings are really only supposed to be for laptops which run on batteries & aren't always plugged into the wall. They're not meant for desktop computers.
There may be a conflict with the power settings & avast, I don't know. I haven't bothered to look into it since I can fix it by turning off the power settings.