Hi Travis,
For code that you only want to execute when parameters change, you may want to put the code in the Initialization commands section in the Initialization pane.
From the doc:
"Initialization commands for all masked blocks in a model run when you:
- Update the diagram.
- Start simulation.
- Start code generation.
Initialization commands for an individual masked block run when you:
- Change any of the parameters that define the mask, such as MaskDisplay and MaskInitialization, by using the Mask Editor or set_param.
- Change the appearance of the masked block, for example by resizing or rotating the block.
- Change the value of a mask parameter by using the block dialog or set_param.
- Copy the masked block within the same model or between different models."
Dialog Callback commands are generally intended only to update the dialog display for example by hiding or revealing parameters based on a check box or drop-down menu.
From the Doc: "You can use such [Dialog] callbacks to create dialog boxes that change in appearance depending on the changes the user makes to control settings, such as enabling an edit field when a user selects a check box."