Waiting for a Scene to complete

In my script a function begins processing, however in the middle I call a custom scene based on Scene_ItemBase

SceneManager.push(Snow.Gather.Scenes.ToolChoice)However my script carries along without caring if the Scene is terminated or not, is there anyway to go about waiting for the scene to be terminated before continuing on without stopping the Scene in the process?( I've used a while loop to check but the entire game stalls, which I realised was a stupid idea in about 2 seconds before testing as well.)

Code for Scene and Windows:

Spoiler
Code:
// Windowsvar ItemChoiceWindow = function() {	this.initialize.apply(this, arguments);}ItemChoiceWindow.prototype = Object.create(Window_ItemList.prototype);ItemChoiceWindow.prototype.constructor = ItemChoiceWindow;ItemChoiceWindow.prototype.initialize = function(x, y, width, height) {	Window_ItemList.prototype.initialize.call(this, x, y, width, height);	this._data = [];	this.activate();	this.refresh();    this.select(0);}ItemChoiceWindow.prototype.makeItemList = function() {	this._data = Snow.Gather.TempItems;}Snow.Gather.Windows.ItemChoiceWindow = ItemChoiceWindow;var ItemChoiceHelpWindow = function() {	this.initialize.apply(this, arguments);}ItemChoiceHelpWindow.prototype = Object.create(Window_Base.prototype);ItemChoiceHelpWindow.prototype.constructor = ItemChoiceHelpWindow;Snow.Gather.Windows.ItemChoiceHelpWindow = ItemChoiceHelpWindow;// Scenesvar ToolChoice = function() {	this.initialize.apply(this, arguments);}ToolChoice.prototype = Object.create(Scene_ItemBase.prototype);ToolChoice.prototype.constructor = ToolChoice;ToolChoice.prototype.initialize = function(data) {	Scene_ItemBase.prototype.initialize.call(this);}ToolChoice.prototype.create = function() {	Scene_ItemBase.prototype.create.call(this);	this._createItemChoiceWindow();	this._createItemChoiceHelpWindow();}ToolChoice.prototype.start = function() {	 Scene_ItemBase.prototype.start.call(this);}ToolChoice.prototype._createItemChoiceWindow = function() {	this._itemChoiceWindow = new Snow.Gather.Windows.ItemChoiceWindow(0, 100, Graphics.boxWidth, Graphics.boxHeight - 100);	this._itemChoiceWindow.setHandler('ok', this._onItemChoiceWindowOK.bind(this));	this._itemChoiceWindow.setHandler('cancel', this._onItemChoiceWindowCancel.bind(this));	this.addWindow(this._itemChoiceWindow);}ToolChoice.prototype._createItemChoiceHelpWindow = function() {	this._itemChoiceHelpWindow = new Snow.Gather.Windows.ItemChoiceHelpWindow();	this.addWindow(this._itemChoiceHelpWindow);}ToolChoice.prototype._onItemChoiceWindowOK = function() {	var selected = this._itemChoiceWindow.item();	Snow.Gather.TempItems = selected;	console.log(Snow.Gather.TempItems);	this.popScene();}ToolChoice.prototype._onItemChoiceWindowCancel = function() {	this.popScene();}Snow.Gather.Scenes.ToolChoice = ToolChoice;
You would need to show us the section of code, not just one line.
You would need to show us the section of code, not just one line.
I don't see how showing any of my code would really help, since I'm asking more about how to implement something that doesn't rely on my code any more than what I've posted. (The scene type I'm extending from and how I'm adding the Scene)

Put I'll put up the code for the scene and windows in the OP if it does help.

Nevermind, I've solved this myself, I've separated the main function into two parts, the second part gets called when the item has been selected.

Original thread: https://forums.rpgmakerweb.com/threads/waiting-for-a-scene-to-complete.48176/