I have not really used glade and this may be grasping at straws but is the process that is started backgrounded because is it possible the execution time of the application going a lot longer than you think? Also are you by chance creating an endless loop. really the code to exit the loop needs to be in the loop itself. i.e.
Code:
While btnToggleTXT = "Record On"
run(process)
wait 3
if btnToggleTXT = "Record Off" then
exit while
end if
End while
This isn't in any real programming language, but you get the logic behind it. The loop continues forever unless the exit criteria is met. In your scenario you might put a test in after the pause to test if the variable record is still 1 and if it is no longer 1 then you can exit your loop., However, does the application you are calling exit after it finishes too, if it continues to run then you may have to call code to kill the application or exit it. Just some ideas I may be wrong, as a matter of fact I don't see a loop in your code anywhere so it would seem to me you start execution but never end it. I wish I could help you more, but I don't know that much about perl or glade. Let us know if you get it figured out.