[Release] Virtual Alexa Switch/Button

That code is for a DTH, device type handler, which you would paste into the “my device handler” section of the IDE.

By chance did you paste it in as a smartapp? That would generate that error.

If you are unfamiliar with custom code, the following FAQ will explain the terms and concepts. (The topic title is clickable link.)