note: I am going to assume that you have downloaded the relevant parts of the jQuery UI library, that you have copied the contents of the relevant JS file(s) into the Story Javascript area of your project, and that you have copied the contents of the relevant CSS file(s) into the Story Stylesheet area of your project.
If you click on the View Source link on the Accordion related page you linked to you will see that there are two main sections to the example:
1. The HTML elements that make up the DATA portion.
Which consists of the accordion ID'ed div element and it's children. You should be able you copy that section 'as is' into a Passage, however because SugarCube automatically converts all line-break within a Passage into HTML br elements and because these can interfere with CSS based layout I would wrap that example content with a <<nobr>> macros.
2. The JavaScript that applies the Accordion effect.
You will need to delay the execution of the accordion() function to after the HTML elements that represent the current Passage have been added to the current HTML page, and you can use the 'Passage display' related Passage Events & Task Objects to do that.
The following Passage content is a cut down version of the HTML code mentioned in point 1 combined with the JavaScript code mentioned in point 2.
<<nobr>>
<div id="accordion">
<h3>Section 1</h3>
<div>
<p>Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque.</p>
</div>
<h3>Section 2</h3>
<div>
<p>Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus.</p>
</div>
<h3>Section 3</h3>
<div>
<p>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis.</p>
</div>
<h3>Section 4</h3>
<div>
<p>Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
</div>
</div>
<</nobr>>
<<script>>
$(document).one(':passagedisplay', function () {
$("#accordion").accordion({
collapsible: true
});
});
<</script>>