Okay firstly, Ditto cannot be encounter slot 5, only 6 or 7. The way it works is that whatever pokemon Backlot says he found in the Trophy Garden takes the encounter slot of 6. However, the pokemon that showed up the day before would take encounter slot 7. For example, say you go to Backlot and he says he saw a Cleffa or some shit in his garden. You don't care about Cleffa, so you leave and come back the next day. Then Backlot says "OH SHIT I FOUND A DITTO BACK THERE"
Then Cleffa would be encounter slot 7, and Ditto would be 6.
If you wanted to RNG Ditto, then you have to look up a frame that gives you the right encounter slot (either 6 or 7). Verify your seed with coin flips. They have no effect on captured pokemon, so don't worry about doing the wrong advancements. Once you verify you hit your seed, you can either do journal flips or Chatot method to advance the RNG. Sweet Scent in grass advances the frame by 2. So what you want to do is subtract 2 from your target frame, and if the number is even you can just do journal flips then sweet scent to encounter Ditto. If it's odd, you can turn once in the grass without taking a step to advance the RNG by one, or you can use Chatot. Then finish up the rest of the advancements using journal flips.