Use model.active_entities, working in model.entities IF it's not the current context will BugSplat.

You can get references to the objects which result from the explode operation [any previous reference to that line etc will get lost as it explodes]
exps = group.explode
Gives you an array - in your case it'll probably be an array containing one line...

You could then remake a group in the active_entities with group2 = entities.add_group(exps) or perhaps exps.grep(Sketchup::Edge)[0]

If you want to replicate the group then after the first group is made you simply add a copy of it, then explode the original, so that the edge is now in the copied group, and it is replicated back in the active_entities...

group.entities.add_line(...) group2 = entities.add_instance(group.definition, group.transformation)

Now explode the original 'group' back to the edge in the active_entities...
The second copy 'group2' remains, it contains the replicated edge...