Instead of your current msg command, try the following command:
msg $chan $mid($1-, $calc($pos($1-, ->, 1) + 2), $calc($pos($1-, <-, $pos($1-, <-, 0)) - $pos($1-, ->, 1) - 2))
This line will take the first occurrence of -> and last occurence of <-, and message everything that's between them.