Is there a way to fire a script when the button is pressed, so that the script replaces all the steps normally performed by clicking the button?
You can use custom menus to replace the built in menu item.
Bruce is right, but redefining menus is not the easiest or most intuitive action in FileMaker. Basically, you duplicate one of the standard menus ("Requests Menu", in your case), and change a menu item ("Perform Find") just overriding its default behavior with a "Perform script" under the Action checkbox. Be sure to leave the "Based on existing command" checked, and your script will be invoked even when the user presses the Toolbar icon.
Those buttons use internal 'scripts' and aren't available to developers.
You can hide the status bar and create your own in a header that has the same functions as FileMakers buttons.
Simplest would be to use global fields on a layout with a find button on it that contains your script. This avoids all the complexities of enter fine dmode, etc.
Go to layout with globals
Find button Cancel button (go somewhere else)
Set global to variable
use variable ina perform find script step.
Which steps are you looking to replace? The act of finding the records? What are you planning on doing instead?
Another answer is to have an OnModeExit script (or onModeEnter depending on what you're actually trying to accomplish).
Retrieving data ...