Do the following, just tested, steps:
- Add the parameter
-console
to Launch Settings of Portal 2. - Launch Portal 2 (developer console should be already there).
- Write and execute in console:
bind f11 toggleconsole
- Test that pressing
F11
toggleF11 toggles the console. - Now exit Portal 2 and relaunch it. Everything should work as expected.