A separate patch to refactor that in the existing gist opclass would probably be best.
Done. There are separate patch for get rid of TrickFunctionCall2 and version of SP-GiST for ranges based on that patch.
Committed the get-rid-of-TrickFunctionCall2 patch. I also changed one call in range_gist_same(), which was not using TrickFunctionCall2 but was nevertheless doing the same thing in spirit.