The way I would first try to approach this problem would be (1) to programmatically take a screenshot and then (2) check the resulting image for the existence of the green light in the specific location. Part 2 is specific to your requirements, but a couple of ways you might try to do part 1 are:
(A) use a java.awt.Robot (from within MATLAB), which has a method createScreenCapture for capturing a screenshot. Here is how I have used it in the past:
r = java.awt.Robot();
monitor_positions = get(groot(),'MonitorPositions');
monitor_positions(:,1) = monitor_positions(:,1)-1;
monitor_positions(:,2) = 0;
pos = monitor_positions(1,:);
cap = r.createScreenCapture(java.awt.Rectangle(pos(1),pos(2),pos(3),pos(4)));
w = cap.getWidth();
h = cap.getHeight();
rgb = typecast(cap.getRGB(0,0,w,h,[],0,w),'uint8');
rgb = cat(3,reshape(rgb(3:4:end),w,[]).',reshape(rgb(2:4:end),w,[]).',reshape(rgb(1:4:end),w,[]).');
This will give you rgb, a 3d matrix of type uint8 representing a screenshot of the 1st monitor (i.e., the monitor whose screen position is given by the first row of get(groot(),'MonitorPositions')).
(The systems I use this on only ever have one monitor, and on the mulitple-monitor system I'm using now, it gives some incomplete/incorrect result. But I'll leave it here as a reference/starting off point for you to try to adapt it to work on your system.)