BBEdit supports AppleScript automation very thoroughly. See Chapter 13 of the BBEdit User manual.
You can save an AppleScript to the BBEdit Scripts folder and it will appear as a menu item in the Script menu (fancy scroll-S icon) so that you can call it by selecting it from the menu.
To automate the find-and-replace command, for example, you'd do something like
Code:
tell application "BBEdit"
activate
open find window
replace "text to be replaced" using "desired replacement text" searching in text 1 of
document 1options {search mode:literal, starting at top:true, wrap around:false, backwards:false, case sensitive:false, match words:false, extend selection:false}
end tell