This seems as though it would be a driver issue with the Surface or the pen itself, but they both behave normally in every other program. The drivers are up to date, and the pen input works correctly in Photoshop CC, Flash CC, and even Premiere Pro CC.
After Effects seems to not recognize the pen input. Hovering the pen shows the cursor where you would expect, but when I tap the screen, nothing seems to happen. Usually once this happens, the pen continues to not register any clicks. Once this is happening, moving the cursor with the trackpad causes the cursor to move, but as I was clicking and dragging, and continues to do so until clicking with the trackpad.
I have managed to use the paintbrush and eraser very rarely, after making a stroke while holding the eraser button. I can't seem to replicate that reliably. Sometimes the brush will work when holding the eraser button, but most times it will not. The right-click button behaves similarly, occasionally pulling up the right-click menu, but more often not.
This issue is present with the Surface pro 4, as well.
I don't have experience with either of those tablets, so the best advice I can offer is to file a bug report. Feature Request/Bug Report Form
I know Adobe is focusing a lot on making their apps more tablet-friendly, so I'm sure they will appreciate the input.
Same in Dreamweaver