I never did get a response on changing the text, but the number of actions can be manipulated like this (this is my Tiamat script and it does change the number to 5). I get the feeling that the text is baked inside the legendary action scripting that we cannot see.
Final Phase/10,000
Code:
herofield[tLegAction].value = 5
As a workaround I put the following text into Tiamat's description to remind myself:
"{b}{i}Legendary Actions:{/i}{/b} Tiamat's legendary actions are based on her 5 heads. If a head has been used to bite, then that head cannot breathe on the same round until the next turn, and vice-versa."