I haven’t tested it but according to Mail’s dictionary it should be possible.
There is one issue to consider: On many machines there is a final rule which stops evaluating rules.
If your new rule is placed after that rule, it will never be executed.
This is some sample code
tell application "Mail"
set newRule to make new rule at end of rules with properties {name:"myRule", enabled:true}
tell newRule
make new rule condition at end of rule conditions with properties {rule type:subject header, expression:"mySubject", qualifier:does contain value}
set run script to file "disk:path:to:script.scpt"
end tell
end tell