RE: How to traverse the controls of Form extension?
I understand your confusion, but you must realize that the CLR enum Microsoft.Dynamics.AX.Metadata.Core.MetaModel.FormControlType and the X enum FormControlType are two different types and you can simply compare their values.
To use the right type, you may use the fully qualified name:
axFormControl.Type == Microsoft.Dynamics.AX.Metadata.Core.MetaModel.FormControlType::CommandButton
but it's cumbersome, therefore it's better to utilize the using statement:
using meta = Microsoft.Dynamics.AX.Metadata.Core; // this will be one the top of the file
...
axFormControl.Type == MetaModel.FormControlType::CommandButton
Nevertheless you may greatly benefit from working with class (and interface) types directly, which you can easily do with is and as operators.
For example, what about replacing your complete code with just a single line?
return axFormControls is IAxFormActionButtonControl;