I think ATP will not deduct 5 points unless he was ranked to play more than 3 MS before and he had not do it but if that was the case ATP should had include them as DNP.
At the end of the year after he plays Basel and Paris, ATP should deduct 5 points if he earns 5 or more in Basel as he will have more than 18 tournaments. 4 GS + 5 MS + 10 non mandatory.
Am I right?
Yes. If he picks up more than 5 in Basel it will displace Vienna, and join the other 7 non-mandatorys, the 0 from Queen's Club, and the 5 MSs and 4 GSs for 1+7+1+5+4 = 18 tournaments.
Further to your question about being eligible for MS events, yes if you are eligible but do not enter an event, you get a 0 listed on the ATP profile (see Nalbandian for Toronto + Cininatti, or DelPo for Indian Wells). So between Rome and Madrid Del Potro was not eligible for any of them, and though (if I recall correctly) he could have gotten an SE for Toronto, that does not count as being 'eligible'.