close but not quite. you didn't actually put the code inside the code block. clicking on the 'code' item in the "#" icon puts the start/end symbols for the code block into your post. You can make a blank line between them, and that's where you paste your code. Or, you can first paste your indented code, then highlight the block, and then click to put the code block symbols around it.

Also, pasted code should come from the scripts editor where it's indented, rather than pasting from somewhere else where the indents were lost.