Have you seen Scanned image scratch removal with “ICE” - #69 by chris ?
There is a filter in gmic that can do this.