Can anyone explain exactly what is going on here? I understand up to the class << self part, but I don't quite understand aliasing the method new to new_no_dup, only to call it in the new method below? Also, why do you think the author want to do this in this manner?

If you run the same snippet, changing local = s.dup to local = s, then the final value of greeting will be "HI" because shout will have modified greeting. .dup returns a copy of the original string, preventing modifications to the original.