You have to click "Code fragment mode" in the evaluate expression dialog (Alt+F8) and you can enter as many lines as you want instead of single line - which is default - "Expression mode".
Then you can switch back anytime using "Expression mode" button.