Adjusting a boolean parameter in a material instance in code?

I’m trying to override a boolean parameter in a material instance in an editor plugin.

Texture parameters can be overridden without problems with SetTextureParametervalueEditorOnly, but…
there’s no such thing for boolean parameters.

I’ve tried the following by looking at PreviewMaterial.cpp, and it does update the UMaterialInstance in VS’s watch window, but doesn’t get reflected in the final version that gets saved it seems… What am I missing?

bool testBool = false;  // throwaways for checking purpose
FGuid testGUID;
if (sourceMaterial->GetStaticSwitchParameterValue(FName("WorldVertexTransition"), testBool, testGUID)) 
	// do we have the switch bool?
	// grab all material params, including those of the source
	FStaticParameterSet updatedParams;
	for (int paramIdx = 0; paramIdx < updatedParams.StaticSwitchParameters.Num(); paramIdx++)
		if (updatedParams.StaticSwitchParameters[paramIdx].ParameterName == FName("WorldVertexTransition"))
			// Flip the boolean to what we need and override it...
			updatedParams.StaticSwitchParameters[paramIdx].Value = switchBlend;  
			updatedParams.StaticSwitchParameters[paramIdx].bOverride = true;
	// does this do anything? Doesn't seem so
	newMaterial->bHasStaticPermutationResource = true;  
	// this does absolutely nothing, even though it should!
	newMaterial->UpdateStaticPermutation(updatedParams, true); 
	// next one doesn't help either

This is the material parameter I’m trying to adjust, and I’m totally okay with it needing to be recompiled or whatever if necessary.

Actually, seems to do what it needs to after a night of not touching it.
Need to remove line 20 or it’ll somehow turn the FMaterial::GetRenderingThreadShaderMap() call the engine does into a null object, though.
(24 is just superfluous)