One of the problems with automating this type of operation is that a planar object’s plane can have a normal that faces either way. That is to say it will extrude in one of two directions, but you can’t predict which direction it will go without an analysis of the plane’s normal. The same thing will happen with OffsetSrf. (note that OffsetSrf is only a substitute for Extrude when the surface is planar, which I assume is the case here)
There are some possible workarounds to this, ranging from having the user pick a point for side to extrude and then trying to figure out the closest direction to that (won’t work all the time) or providing the user feedback before extruding and allowing them to manually invert the direction on some objects (which is what OffsetSrf does, can be time consuming and error-prone if there are many objects).