While I've not come across a compound that can be used in the tank underwater, there are several kits out there that use extremely fine sandpapers that can be used underwater. Pentair Aquatics (Lifeguard) makes one that uses about 10 different grit papers with the finest being something crazy like 12,000 grit. I've used this kit to remove several scratches from acrylic. While it is tedious, it gets the job done, and is safe even with invertebrates and the tanks full. I've always done it by hand, but you'll see some kits that are meant to be used with a cleaning magnet used to maintain consistent pressure.
There's also papers that can be mounted to a pneumatic random orbital sander for big jobs. Although if you don't really rinse out the sander afterwards and dry it out very well, it's a one tool per job kind of thing....
Steve