It seems like there could be some creative use of the sed or awk commands to get this done from the command=line. I'm not really much of a command-line ninja, but I'd be curious to see what that solution would look like.
I'd also map the trigger to something similar to command-v, maybe command-option-v, and then just paste like normal. Make it feel natural and all.
