I've never come across SMB scripting and I've done alot of Windows server admin.
SMB is a protocol, like HTTP or Telnet, it defines the port used (TCP 445) and the format of the data that passes around. There's other stuff defined too like opportunistic file locking, but that's beyond the scope of this.
As far as I know you can't change how the process happens.
The only way I can think of to carry out your idea is for your firewall to execute a batch file or WScript when it receives a connection to 445. However, this probably won't work.SAMBA
is an open source implementation of SMB, you may get more info there.