Here's what I would do:
Cody wins rumble - faces Reigns for title Night 2.
Stone Cold vs Brock Lesnar main events night #1 - Rock as special guest referee. Make this a blowout spectacle - probably ends with Austin going over heel Lesnar, with Rock raising Stone Cold's hand at the end and drinking beers...no titles involved.
Earlier in night 1....Reigns/Rock have a backstage interaction. Reigns acts all cocky, assumes Rock knows he's the best, etc. No phyiscal altercation or anything like that, but you can definitely feel Reigns disrespected Rock, or Rock is pissed.
Night#2 - Cody vs Reigns. Have Rock show up and help Cody win (if you want Cody to have "clean" win, it could simply be a case of Rock chasing bloodline away, instead of overtly attacking Reigns, either/or). End result - Cody is champion, Reigns loses and puts Cody over, and seeds are planted for mega heat between Rock and Reigns.
Does this lead to a WM40 match between Reigns and Rock? if Rock is available, sure. If not, then no. Still a fun and satisfying event for WM39.
Of course this is assuming Rock is available for WM39 - but I can't imagine he wouldn't be for one night only. If he's not wrestling, it's much less demanding of him/much less risky.