Here's an example script you might consider trying (after amending it):
doc -e W // W is for each worksheet which is what you want to do
{
%A=%H; // store active window name
nlsf.init(); // initialize the fitter
nlsf.func$=MyLine; // initialize the function to be used
nlsf.p1=0.1; // initialize the parameter values
nlsf.p2=0.1;
nlsf.fitData$=%(%A,3); // initialize the dependent dataset
layer -a; // rescale the graph when it comes up
nlsf.wType=2; // statistical weighting
nlsf.fit(100); // 100 iterations
nlsf.xmode=0; // use same X as fit data
%A!wks.col$(%A!wks.ncols).name$="FitData"; // rename fit data column to "FitData"
};
Note 1: Anything in red must be tailored to meet your needs.
Note 2: The function must be defined in the fitter with the Same X as Fitting Data radio button selected in Scripts => After Fit. To get to this window, make sure you are in the "advanced" mode of the fitter. To get to the advanced mode, click the More button. If you don't see a More button (and instead see a Basic Mode button), you are in the advanced mode already.
Note 3: Initializing the parameters using nlsf.pn must be done in the same exact order as they are defined in your function in the Parameter Names text box. In your case, that might be as follows (assuming A,B,G,n is how you ordered the parameter names in the text box):
nlsf.p1=1; // initialize A
nlsf.p2=1; // initialize B
nlsf.p3=200; // initialize G
nlsf.p4=1; // initialize n