There are ceramic trimmer potentiometers available with a diagonal of 3.57 mm (Panasonic EVM2N) and up, that could be used for the purpose:
(from Digikey listing)
The trimpot could be mounted face-on to the back of the "LED pen", to provide the rotation sensing required.
Note that trimpots are designed for very few rotations, from a few hundred to a few thousand times at best.
An alternative if you are looking for durability, is to mount an analog omnidirectional Hall effect sensor such as Allegro A1326 along one edge in the fixed portion pen, and a small magnet on the rotating portion:
Such sensors provide a ratiometric voltage output for magnetic field strength, the polarity being indicated by voltage above and below the midway value of the supplied voltage.
Using this method, non-contact sensing of rotation is possible: As the magnet is rotated, field strength increases to a maximum for North, and then reduces to zero, and increases again to a maximum for South. The corresponding sensor output would be a somewhat sinusoidal voltage against rotation angle, simple to sense and use.