Please include the full version number of your story format when asking a question, as answers can vary based on that information.
Also if you ask a question that requires third-party macros (like the <<pickup>> and <<drop>> in your example) to run then please include either: a link to where ever you obtain those macros from; or a copy of those macro's source code. Doing that will help those testing your copy because we don't always know which third-party macros you are talking about.
eg. There are many different implementations of an Inventory system.
Assuming that your code example is an exact copy of the relevant code within your passage then it has a number of syntax errors in it.
1. The <<if $playerInv.has( line is missing a closing parenthesis at the end of the has() function.
2. The <<goto "I didn't line is missing the closing double greater-than character at the end of the <<goto>> macro.
3. The <<endif>>'s should be <</if>>
<<if $playerInv.has('notebook')>>
<<link 'Drop notebook.'>>
<<drop '$playerInv' 'notebook'>>
<<set $bagspace to $bagspace + 1>>
<<goto "I didn't know what to do...">>
<</link>>
<<else>>
<<link 'Take notebook.'>>
<<if $bagspace gt 0>>
<<pickup '$playerInv' 'notebook'>>
<<goto "I didn't know what to do...">>
<<set $bagspace to $bagspace - 1>>
<<else>>
Your inventory is full.
<</if>>
<</link>>
<</if>>
note: I had to assume that the calls to the <<pickup>> and <<drop>> macros are correct because I don't know which inventory system you are using.