As qwerty says, SetFixedRegion is the way to go. Here is an example:
shape main
{
noshadow=true;
setpenwidth(2);
moveto(0,0);
lineto(100,0);
setpenwidth(1);
// define area to draw decoration in (in this case 20x20 below the centre of the line)
setfixedregion(40,0,60,20);
// draw decoration
moveto(42,8);
lineto(58,8);
moveto(42,12);
lineto(58,12);
moveto(46,4);
lineto(40,10);
lineto(46,16);
moveto(54,4);
lineto(60,10);
lineto(54,16);
}