Using a straight line instead of bkg may be of use, see
http://topas.dur.ac.uk/topaswiki/doku.php?id=background_straight_line_segments
In Version 7 you can use the functions of Bkg_at and Yobs_at in the following manner:
xdd ...
penalty = 10000 (Bkg_at(#) - Yobs_at(#))^2;
penalty = 10000 (Bkg_at(#) - Yobs_at(#))^2;
...
The # numbers corresponds to x-axis values.