Yes. Although I'm normally the first to recommend triggers or waypoints over scripts, in the case of mapclick - which is slightly tricky to work with - I would recommend a script simply because that gives you the most space to work with. It's easier if you can see what's going on.
Your current problem is that the script does not pause to wait for the player to click, it just keeps going. You need to add the @ command so that the script waits for the player to click.