How to have key change indicators at the end of a verse to refrain

Hi, I’ve been a bit stumped on how to have a key change indicator at the end of measure when the next measure is the same key
The key change needs to be at the end of the verses due to the refrain being a diff. key, hopefully the image can explain what I’m trying to do here

I remember having a similar issue with a D.S. needing a key signature similar to your situation. As far as I can remember, it isn’t possible without a lot of complicated workarounds. I searched the forum for those methods but couldn’t find them. I’d suggest searching forum if you haven’t already done so.