It works, thanks a lot!
That code also helped me with my third question (about re-ordering a part's fields/editors). Now I know that UIPartActionWindow has a list of UIPartActionItem and items of type UIPartActionFieldItem are linked to the module field. Then what I think is the display order is the sibling index on the action's transform. Now I want to test it out, but I'm not sure where/when to call the code, I'm sure it would work in OnUpdate, but I don't want to reorder each frame (it may affect performance). So my question is: Is there any event triggered when a part is selected in the editor, or even better if there is an event when the part's window is displayed? If so, how do I listen to it (I'm still not too familiar how Unity or KSP event pipeline works)?
P.S. I can't thank the universe enough for the existence of .NET, reflection and ILSpy