There's a few ways in which Leto's conversation with Jessica "worked".
First, he had to ensure that she see how Alia had succumbed to her inner memories and become the Abomination so feared by the Bene Gesserit.
Second, he wanted to allay her fears that Ghanima and himself would fall into the same trap, by showing how aware of Alia's situation they were.
Third, Leto was demonstrating to Jessica how her Bene Gesserit training has conditioned her to respond to specific phrasing and stimuli - a kind of neuro-linguistic programming (which started to be popularised in the 1970s).
Finally, he wanted to set Jessica on a course which would support the plan Ghanima and himself laid out, and which we see fulfilled throughout the remainder of the book.
Leto saying "it worked" to Ghanima simply means that he is confident that he achieved his intent with his conversation with Jessica.
As for Lady Jessica realising how Leto had "played her like a fine instrument" reveals how she now recognises how the conversation and her Bene Gesserit conditioning have been used by Leto to achieve such recognition.