oh great! the only other fvwm user here who knows more than me is asking a question... ;D
the way i can think of is to do exactly what you are taling about, i.e. write a tcl program and pop it in your fvwmbutton section. I guess you could try poosting to the fvwm mailing list.