This is how they arrived in Gravity Fall and stop Bill Cipher in Ryan's Quest.
They arrived in Gravity Fall and they saw Dipper running from something
Dipper: Help me!
Evil Ryan: What do you think your running from?
Dipper: Well, yeah. And I didn't know them in my Journal.
They saw them coming
Ryan: We'll handle them.
They are fighting them and they defeated them
Ryan: You're right, Sci-Ryan.
Dipper: Thanks for helping me.
Ryan: Why are you going to do?
Dipper: Well, I was gonna save Stan and Mabel from Bill Cipher, but then he summon all those Heartless, you called.
Ryan: Bill Cipher?
Dipper: Can you help me?
Ryan: Sure we can help you.
Dipper: Thanks, come on.
Bill Cipher: What you're saying Mabel is not one of the Seven Princesses?
Kaos: Of course, she isn't. She's not a Princess like the others Princesses. So have make this world into darkness.
Bill Cipher: After I captured her, and why those seven? What is your plan anyway?
Kaos: I do this for the Last Keyhole. And I think I do still things for Cody.
Bill Cipher: Well, we're wasting our time for him. Those Heartless has taken the Girl's heart for their meals. And I think she's gone forever.
Bill Cipher saw Dipper and the others coming
Bill Cipher: I knew, he's coming. I wait till he gets there.
Our Heroes found Bill Cipher
Ryan: We found you.
Evil Ryan: Have you decided to surrender, Bill?
Bill Cipher: Not really, but you can face me and the Heartless.
Ryan: Time to summon King Chrystalize, Simba and Emmet now. Give me strength!
They summon them, they are fighting him and they defeated them
Bill Cipher: I'll be back for this!
Ryan: Bye, bye!
Ryan saw the Keyhole so, he sealed it
Ryan: Time for us to go.
Dipper: You're leaving now.
Sci-Ryan: Should we come back?
Dipper: You can come back to Gravity Fall anytime.
Ryan: Okay, Bye.
They left this world.