The simplest way is to allow the user to select any entities. Just care only about those selected entities that are edges:
edges = Sketchup.active_model.selection.grep(Sketchup::Edge)
Let's say you now need to be sure there is a minimum of edges:
return UI.messagebox("You need to select two or more edges.") if edges.length < 2
The cleanest way would be to implement your own tool class for selecting entities. You would use a PickHelper to get whatever is below the point that the user clicked, and only if it is an edge you would add it to an array or selection (actually you do not really need to add it to the real selection), and then draw/highlight what is selected.
Don't do this until you have enough experience.
If something does not work, please give complete (and minimal!) examples and say what does not work. All I could say about Sketchup.active_model.selection.each
is that it raises an error because it is an iterator method with missing block ("each" is not "edge").