It's definitely working ok with a function. I just did it with one I use to reset a score table.
I just added the:
if (live_call()) return live_result;
directly under the function creation line.