OK, that makes a little more sense. You aren't modifying the Path in between executions, you're setting it once in the context of the machine's installation. Thank you for that context and detail.
Sure, you can write to the MCTagname.Path element of a MESSAGE datatype tag. It's a STRING, with a DINT Length and a SINT[x] .Data section just like any other ControlLogix String.
A description of the gotcha for me when I was using logic to edit the MSG instruction's CIP Path programmatically:
I was writing a sequentially targeted MSG, and my String length incremented by one when I went from .9 to .10, and again when I went from .99 to .100.
Example of the MCTagname.Path STRING value for two subsequently executed messages, using the same control tag:
$02$06$12$0D192.168.21.99$00
$02$06$12$0E192.168.21.100
The .LEN element of each of those ControlLogix Strings is 18, even though the number of characters in the length of the IP address string changed from 13 (0x0D) to 14 (0x0E).
I was just changing the characters after the last dot and didn't realize that I also had to change the earlier byte for the length of that "IOI Segment", and also pad odd-numbered string lengths with a null.