While it's possible to do it the way you have written above, I'd highly suggest trying something like what I wrote below (near the bottom). That said, here is one possible way you could do it using a while loop.
func _physics_process(delta): # or _fixed_process if you are using Godot 2
while(<condition insert here>):
self._process(delta)
There are a few problems with this bit of code though:
The first (and probably biggest) problem is while the loop is running nothing else will be processing. In other words, none of the other processes (like other nodes) will be doing anything while your while loop is running. The game will seem to be frozen until you've finished doing whatever you need to do in the while loop.
Another problem is that it's using _process. Based on what you've stated, you don't really need to use _process. I'd suggest doing whatever you need in its own function, as it will both be easier to maintain and easier to change where it's called if you change your mind.
One final potential snag I can see with the code above is that you cannot do anything else in _process that doesn't relate to your condition checking. Even if you break it into a function like mentioned above, you'll still need some sort of check to see if you even need to verify the condition.
All of that said, here's a bit of code that I think will do what you want while fixing the problems I mentioned above:
extends <insert node here>
# Any time you change this boolean to true, then in _process it will
# do whatever you need to do
var check_condition = false
func _ready():
check_condition = true # If you do not need to check
# at the beginning, then remove/comment-out the line above
set_process(true)
func _process(delta):
if (check_condition == true):
# <Insert whatever you need to do to here!>
if (<whatever needs verifying here is verified>):
check_condition = false
(NOTE: The code above is untested, but it should work, in theory at least :smile: )