You want to use a macro to construct the style definition. Something like this:
\define setWidth() width:$(width)$;margin-left:$(margin_left)$;margin-right:$(margin_right)$;
<$vars width="50%" margin_left="25%" margin_right="25%">
<div style=<<setWidth>>>
content goes here
</div>
</$vars>
notes:
* $vars does the same thing as $set but supports setting multiple variables in the same widget
* I used a "one line macro", which includes the name and definition all on the same line, and thus doesn't need a \end
* I include the "%" symbol in the variable values so that the macro can be used with other type of measurements, e.g.:
<$vars width="20em" margin_left="10em" margin_right="auto">
enjoy,
-e
Eric Shulman