Thanks everyone and especially Amp'd for digging in and even bothering to bug Tesla. The answer is %grade.
Makes sense it's grade related. 4% grade is not much. That's a 4 inch rise over about 8 feet, and is what a concrete slab of a driveway would have to allow water run-off.
But like others have said, there probably should be no grade dependency on the feature working. And this gets away from having to use logic if the car is in D or R and facing uphill or downhill.
The only driving (car in gear) conditions should be "car is at rest and brake pedal is applied". These two conditions becoming TRUE should fire the hill assist trigger to hold braking. Conditions could be arrived at in either order while car is in gear: First the brake is applied then car rolls to stop, then hill hold. Or, the car rolls to a stop, then the brake is applied, then hill hold. Hill hold is held, until go pedal is pressed. So each time the go pedal is pressed the hill hold is cleared. Changing the gear while car being hill held would not cause it to release.
Easy peasy. Whole lot less code, and no trigonometry required.
Tesla: take one of your Apple new hires and have them clean up this piece!