When the function is called, the code inside is executed as it stands. “DoOnce” means when the execution pin hits it, it runs once and then stops. Assuming blueprint functions are the same as standard functions, anything inside can be considered to be local to the scope of that function. This means that they are created when the function is called and pushed onto the stack and destroyed when pushed off.
Your solution for this would be to have a branch before the DoOnce to store a blueprint wide “static” variable boolean that can record whether or not it needs to be run again.