i found by reading ahead in the tutorial that the values to be created in MP_TYPE are literally '0x20', '0x21' and '0x22', not their ASCII or control equivalents. Knowing that here is the code I created based on the original in the tutorial, but using the syntax the QGIS Field Calculator Expression Parser would accept as valid. I believe I interpreted the logic correctly, and I have results that seem to reflect that interpretation:

CASE

WHEN "FCODE" = '10101' OR "FCODE" = '10104' THEN '0x20'

WHEN ( "FCODE" = '10102' OR "FCODE" = '10105' ) AND ( "CONTOURELE" / ( "CONTOURINT" *10 )>100) AND regexp_match( tostring( abs( ( "CONTOURELE" / ( "CONTOURINT" * 10 ) ) / 100 - toint( ( "CONTOURELE" / ( "CONTOURINT" * 10 ) ) / 100 ) ) ) , '5' ) THEN '0x21'

WHEN ( "FCODE" = '10102' OR "FCODE" = '10105' ) AND ( "CONTOURELE" / ( "CONTOURINT" *10 )>10 ) AND regexp_match( tostring( abs( ( "CONTOURELE" / ( "CONTOURINT" * 10 ) ) / 10 - toint( ( "CONTOURELE" / ( "CONTOURINT" * 10 ) ) / 10 ) ) ) , '5' ) THEN '0x21'

WHEN ( "FCODE" = '10102' OR "FCODE" = '10105' ) AND regexp_match( tostring( abs( "CONTOURELE" / ( "CONTOURINT" * 10 ) - toint( "CONTOURELE" / ( "CONTOURINT" * 10 ) ) ) ) , '5' ) THEN '0x21'

WHEN ( "FCODE" = '10102' OR "FCODE" = '10105' ) THEN '0x22'

ELSE NULL END

CASE

WHEN "FCODE" = '10101' OR "FCODE" = '10104' THEN '0x20'

WHEN ( "FCODE" = '10102' OR "FCODE" = '10105' ) AND ( "CONTOURELE" / ( "CONTOURINT" *10 )>100) AND regexp_match( tostring( abs( ( "CONTOURELE" / ( "CONTOURINT" * 10 ) ) / 100 - toint( ( "CONTOURELE" / ( "CONTOURINT" * 10 ) ) / 100 ) ) ) , '5' ) THEN '0x21'

WHEN ( "FCODE" = '10102' OR "FCODE" = '10105' ) AND ( "CONTOURELE" / ( "CONTOURINT" *10 )>10 ) AND regexp_match( tostring( abs( ( "CONTOURELE" / ( "CONTOURINT" * 10 ) ) / 10 - toint( ( "CONTOURELE" / ( "CONTOURINT" * 10 ) ) / 10 ) ) ) , '5' ) THEN '0x21'

WHEN ( "FCODE" = '10102' OR "FCODE" = '10105' ) AND regexp_match( tostring( abs( "CONTOURELE" / ( "CONTOURINT" * 10 ) - toint( "CONTOURELE" / ( "CONTOURINT" * 10 ) ) ) ) , '5' ) THEN '0x21'

WHEN ( "FCODE" = '10102' OR "FCODE" = '10105' ) THEN '0x22'

ELSE NULL END