You may create an Automator service as follows:
Service receives selected [text] in [any application],
Replaces selected text [checked]
Action = Run Shell Script action
Shell = /bin/bash
Pass input = to stdin
/usr/bin/perl -CSDA -pe 's%.(?=https?://)%$&\n%og;'
Service workflow will look like this:
To use it, select text and invoke service (from Services menu or keyboard shortcut you assigned) and it will replace the selected text with the processed text.
Hope this may help,