Evan,
The dialog will stay on screen as along as the script holds a reference to the dialog object. So to dismiss the dialog set your reference to the dialog to invalid (or exit the scope of your automatic variable by returning from the function). For example:
dialog = CreateObject("roOneLineDialog")
dialog.setTitle("Please wait...")
dialog.showBusyAnimation()
dialog.show()
'fetch web API data here
'this will dismiss the dialog
dialog = invalid