Restore database with Availability Groups
I think you need to revise your question with clarity:

Olas scripts meant for following, not for restoring database.


Backup
DBCC - Integrity Check
Maintenance - Index and Statistics  


Aside from this, you cannot DROP or RESTORE a database while it's part of Availability Group. You can remove a database from availability group with following commands:  

PRIMARY Replica:

ALTER AVAILABILITY GROUP AGName remove database DatabaseName;


SECONDARY Replica:

ALTER database DatabaseName set HADR OFF;