I have might have solution that would work with currently used technologies such as bluetooth and Wifi that is in pen and your Microsoft Surface. But you will need to program some parts on your own (most of mentioned techniques are in open source libraries).
After you pair your,pen with Surface you should be connected with Wifi and bluetooth to the pen.
1. Option
There is good article, explaining bluetooth triangulation that we will use for triangulating pen in close area, except we will use bluetooth and wifi (we dont have 3th point) so it will not be so precise as 3 points. But with 2 points you can actually measure distance by this table and find where is theirs intersection, in such small space its doable.

Use similar method with Wifi for second triangulation point, you can see source codes for Wifi triangluation down there.
Next step will be calibrating the position of pen in holder, that means that the
pen will be at one side of the Surface(for simplification lets assume its only at right shorter side)
from this you can compute area of screen
Allowed area:
offsetHeightOfPenScreenRation = ScreenHeight - penHardwareHeight
NonValidX = StartpenPositionX - ScreenWidth < penPositionX or StartpenPositionX < penPositionX
NonValidY = StartpenPositionY - ScreenHeight < penPositionY or StartpenPosition+offsetHeightOfPenScreenRation < penPositionY
penIsClose = not ( NonValidX or NonValidY)

This is how it could work, you will need to keep this software running in background and it could have some serious impact on battery, you will need external wifi adapter for internet.
I dont have Microsoft surface so i cant code it myself cause i dont have device to try it on, but this is working idea. With little tuning of precision it could be really precise positioning.
2. Option
Wifi triangluation: https://github.com/kevindu/wifi-ap-positioning
can be maybe used alone and you can transfer location through the bluetooth if you can get into a firmware of pen, but this option will not be so precise.