Only a sitting President gets to nominate a Supreme Court Justice. That nominee doesn’t become a member of SCOTUS unless he/she is confirmed by the US Senate so your scenario is neither possible nor helpful in determining who could become the Republican nominee for president.
I am fully aware of the process for appointing a supreme court justice. My scenario remains a valid scenario.
Cruz could support Trump in the nomination for the party in exchange for Trump (when he is elected President); nominate Cruz for the vacant SCOTUS justice position.