I agree that an ideal solution would detect multi-line strings (which are allowed in both Ruby and Perl, in several different syntactical flavors) and respect the existing whitespace at the beginning and end of each of those lines. However, I would make the point that any Ruby or Perl programmer using multi-line syntax (other than line-by-line concatenation) is almost certainly not depending on the whitespace being preserved at the beginning and end of each part of their string segments.
Having said that, there are probably exceptions and I can't argue with a safer approach. I don't know how SlickEdit handles beautification in other languages, but if it does any kind of stateful tokenization (rather than straight regex substitution) this would hopefully be possible.