It's possible by using the shape-element constructors that take color and dash-style parameters:
Shape myShape = new Shape(Shapes.Rectangle.Outline,
new ElementTemplate[] { new LineTemplate(0, 0, 100, 100, Color.Red, DashStyle.Solid, 0) },
null, FillMode.Winding, "myShape");
diagram.Factory.CreateShapeNode(10, 10, 100, 100, myShape);
When specified as arguments, the element's color and style override the one se through the ShapeNode.Pen property.
You could also set the pen values in a shape-library file using the "color", "dash-style" and "width" attributes.
I hope that helps,
Stoyan