I've outlined a function for that and started to write the code. At a high level it's straight forward, but the details are complex. It'll probably be a year before it's done.
>> And a way to define parameters (not sure if that's already possible).
This is an active work in progress. A demo was made years ago, but it's buggy and incomplete. We've been working out the details on how to make it work. I hope to get the units issue dealt with this week. Then the relation constraints can be re-integrated on top - that's the feature where you can type arbitrary equations on the sketch using named parameters (variables). I'd like that to be done this year if not this summer.
By the way, if this would make things simpler, perhaps you can implement chamfering as a post-processing step. This makes it less general, but it would still be super useful.
And a way to define parameters (not sure if that's already possible).