It works on a selection so you need to select some objects before running the code.
Incidentally, I recommend that you do use a component for the marker, otherwise a raw geometry circle will have many 'parts' [face+all_edges] that with each return a 'center' !
Were there no messages in the Console?
It probably said 'true' when it immediately finished processing the empty selection !
Try as I say and report what happens... It works for me.
here's the line with the 2 'center' methods added...
m=Sketchup.active_model;a=m.selection.to_a;m.start_operation('x');a.dup.each{|o|;g=m.active_entities.add_group();e=g.entities;(a-[o]).each{|i|e.add_line(o.bounds.center, i.bounds.center)}};m.commit_operation