Better is debatable, but you can make a plugin execute a command, so you could have the plugin run in the background monitoring the variable, and trigger a command when it's relevant.
The advantage of a command in VoiceAttack would be ease of use. You can modify the actions without having to recompile the plugin, and frankly it's simpler to put together.
If you opt for a loop inside the plugin, I would strongly suggest you make it possible to shut the loop down.
You could use the plugin context to pass either a "Start" or "Stop" directive, which would either start the loop(if it's not already running), or stop it, respectively.
Under "VA_Invoke1" you'd have something like the following:
If vaProxy.Context = "Start" Then
If LoopRunning = False Then
LoopRunning = True
'Insert your While loop that runs as long as "LoopRunning = True"
Else
vaProxy.WriteToLog("Start called when loop is already running", "red")
End If
ElseIf vaProxy.Context = "Stop" Then
LoopRunning = False
End If
Aside from filling in the loop, you'll also have to declare the boolean "LoopRunning" somewhere where it won't be cleared when "VA_Invoke1" is called.