I was just saying that the value it shows was as expected if it would trigger at month 2.
But it is strange that >= 3 doesn't work, try replace that line with:
if ($msgtags(msg-param-months).key > 0 ) && (3 // $msgtags(msg-param-months).key) {
X > 0 -> makes sure that it have to be larger then 0
3 // x -> makes sure that it have to be 0 3 6 and so on