Hi djaib and welcome to the forums!
The answer to this question is going to depend on a few things... the model of switch and the software release they are running.
Traditionally loading an ASCII config file to a Avaya/Nortel switch isn't as straight forward as say a Cisco or Juniper switch. In order to be successful you generally need to factory reset the switch prior to loading the ASCII configuration file. Why? Well the ASCII config file is going to get "played back" into the switch much like you if you just sit at the console and typed all the commands yourself. Unfortunately some of the commands will bomb if they have already been configured beyond a default configuration.
With that said I believe Avaya has been trying to address this problem in their later software releases although I haven't had the time to test myself.
I don't know that automating the restoration will be possible unless you have a terminal server or code activated switch connected to the serial port.
Good Luck!