This is tricky, because once you've changed a screen's title, you became responsible for that string. For example if you want to make it permanent after your program exits, you have to AllocMem/AllocVec some public memory for it, but then you end up leaking memory after each change.
If the goal is to change the title only for the duration of the program, then this may work:
struct Screen *screen = LockPubScreen(NULL);
if (screen)
{
STRPTR oldTitle = screen->Title;
SetWindowTitles(screen->FirstWindow, (STRPTR)~0, "New Screen Title");
// do your thing
SetWindowTitles(screen->FirstWindow, (STRPTR)~0, oldTitle);
UnlockPubScreen(NULL, screen);
}
Keep in mind, that this is a bit hackish, so proceed with caution.