Forbid()/Permit() would be needed if the new function acts as a wrapper for the old library function instead of replacing it entirely.
int (*oldFunc)(void);
int newFunc(void) {
IExec->DebugPrintF("SomeFunc() called\n");
return oldFunc();
}
/* ... */
/* Patch SomeFunc() in ISomeLib with newFunc() */
IExec->Forbid();
oldFunc = IExec->DoMethod((struct Interface *)ISomeLib, offsetof(struct SomeLibIFace, SomeFunc), newFunc);
IExec->Permit();
Without the Forbid() in the above example newFunc() might be called before oldFunc has been set, leading to an ISI as it tries to jump to a NULL pointer.
If the function in question is supposed to be callable from interrupts then Disable()/Enable() will need to be used instead of Forbid()/Permit().