Sort and select by geometry description type

I modified my script to use a polygon with N sides instead of a square, so I need to find a parametric way to only grab extrusion edges and not the sides of the generated polygons.

I’m not entirely sure what is the internal order of edges that are returned. But you can use some properties of the resulting object to extract the desired edges. For example in your shape the edges you want are the longest. So you could create a list of edge lengths, and sort that, which also allows you to sort the list of edges.