I'm not a "professional" either, so I took a simple approach
This is the custom command, that just sets a variable to "true", if the button is pressed
create_command("FlyWithLua/MU2/detent_pressed", "Press Throttle detent", "", "detentpressed = true" , "detentpressed = false")
The mapping from axis to manips is
if Throttle_3 >= 0.5 then THR_L_manip = Throttle_3 L_inbeta = false end
if Throttle_3 < 0.5 and (detentpressed == true or L_inbeta == true) then THR_L_manip = Throttle_3 L_inbeta = true end
if Throttle_3 < 0.5 and detentpressed ~= true and L_inbeta ~=true then THR_L_manip = 0.51 end
it maps straight if the axis is above flight idle (first line) or the detent is pressed or it already is in beta (second line).
Else, if the axis is below flight idle, but the detent isn't pressed or it's not already in beta, the manip is set to 0.51