In general time spent in the UK on a visit visa can count towards Long Residence. You should read this guidance on Long Residence. Successful application under the Long Residence route requires 10 years continuous lawful residence, defined as:
Lawful residence is defined in paragraph 276A of the Immigration Rules as a period of continuous residence in which the applicant had one of the following:
existing leave to enter or remain
temporary admission within section 11 of the 1971 Immigration Act where leave to enter or remain is subsequently granted
an exemption from immigration control, including where an exemption ceases to apply if it is immediately followed by a grant of leave to enter or remain
So any time with leave to remain or enter counts, there is no exclusion for time spent as a visitor.
Note this section on breaks in residence:
Continuous residence is considered to be broken if the applicant has:
been absent from the UK for a period of more than 6 months at any one time
spent a total of 18 months outside the UK throughout the whole 10 year period
left the UK before 24 November 2016 with no valid leave to remain on their departure from the UK, and failed to apply for entry clearance within 28 days of their previous leave expiring (even if they returned to the UK within 6 months)
Since you left the UK in July 2010 and your leave to enter using your visit visa expired in October 2010, and you made your Tier 4 application in September 2010, it appears to me that you did not break your residence, since you didn't leave for more than 6 months, and you made your application for Tier 4 leave before your visit leave expired. Therefore, you could apply in May. In fact, you can make your application up to 28 days early, in April.
There may be an issue if your visit visa was single entry: almost all visit visas to the UK are issued as multiple entry, but if yours was not, your leave to enter may be considered expired the moment you left. In that case, you would have broken the 28 day rule.