From what I see in the LensDistortion API documentation, I think you need the following:
lensdistortion.centerX.value = 5f;
lensdistortion.centerY.value = 5f;
lensdistortion.intensityX.value = 5f;
The fact that some of the property changes were working as expected, but some of them were giving what effectively looked like syntax errors was a very useful clue. That suggested to me that there was an API supporting at least some of this, but that it was likely either incomplete or inconsistent with regards how the Inspector refers to Lens Distortion. Most of the documentation I found was for the Inspector; searching specifically for the API lead me to the solution.