If the goal is simply to have an easy way to turn on and off the behavior inside OnBeforeResponse, that's easy-- look at m_Hide304s in the script for an example of controlling the behavior using a menu item.
If you always want to return the same modified response, you don't need a script for that. Edit the response (either at a breakpoint or by using the "Unlock for Editing" command on the Web Session's context menu) then drag/drop the Session to Fiddler's AutoResponder tab to create a new rule that always plays back that response.
To always respond with a script, make a rule like:
Save the rule. Click Rules > Customize Rules. Inside the Handlers
class add the following code:
static function DoMagic(oS: Session)
oS.oResponse.headers.StatusDescription = "Magic!";
oS.utilSetResponseBody("Some magic just happened to session #" + oS.id);
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Feedback Portal
and vote to affect the priority of the items