Ok, after much trial and error from a complete php noob, I've figured a few things out.
First, I have verified that using a $variable inside the .mailfilter file works. I stripped out quite a bit of the .mailfilter file as follows:
### BEGIN FILTER_ID:2
myfolder = "$DEFAULT/.Yahoo Groups.BGTEditors/"
### END FILTER_ID:2
Assigning myfolder must happen without $. Trying to assign it as $myfolder breaks it. Also, the $DEFAULT/.Yahoo Groups.BGTEditors/ MUST be wrapped in quotes. Not having these also breaks it.
Now, not knowing how ISPConfig writes these rules, I can only assume that having multiple rules with only 1 $myfolder would break things. I plan on changing this variable to [filter_id]EndFolder as such; 2EndFolder. As each FilterID is unique, this should help avoid variables being named the same.
Right now, I'm working on modifying the mail_user_filter_edit.php to write the .mailfilter as above. I'll work on changing the variable later.