Expressions are placed on the property you wish to control with the code. You need to alt/option click on the stopwatch for the property and then paste the code there.
Expressions are NOT the same thing as After Effects scripts. Scripts in After Effects are like macros which control production workflow, they are jsx files and are either simple jsx or compiled jsx which are placed in the Scripts folder inside the After Effects application folder. They are then available either through the Edit menu (Edit>Run Script) or through the Window menu if they are the appropriate type of script and have been placed in the Scripts UI Panels folder in the Scripts folder.
Plain scripts can also be invoked from the Edit >Run Script command when they are located elsewhere on your computer, they don’t have to be placed in the Scripts folder to work.
You were trying to run an expression (something that drives effects parameters or keyframes) as a Script, just won’t work.