When using an f:optionalBlock in a config.jelly file, the optional block is not indented like the other entries on the form. See the attachment for an example. See the URL for a config.jelly that exhibits this problem.
In that code, I've worked around the problem with an explicit margin-left: 2em on the enclosing table.
The layout issue might be related to the enclosing f:block and table elements, but if I leave those out, then the optionalBlock is always expanded when first opening the form, even if the checkbox is not checked.