Create a text object and use it to debug your program and you can use the debugger as well. For example, to see if your code is functioning right you can put a SetText call to see if that code is reached. I don't have Construct with me at the moment so not sure your syntax is correct or not....but you should try setting the 'sizeaccel' value to let's say "1" to debug that portion of your script.
I think you need a "do once" type event for this as well since you only want that code executed one time you press the A key.
EDIT: This post will help you (this question sounded familiar