Thank you for the mention Greg! Both Rajesh and Sanford provided great solutions!
Though I would NOT disable registration. You still want the opportunity to capture someone's details. For this purpose I always automatically put registrants in the status "Pending Approval" and send them a temporary email stating an employee would get in contact to verify if there were still seats remaining. Then have a workflow that automatically sends an email (sorry,... or we hereby confirm...), based on the program status being manually updated to Registered or Rejected or WaitListed. This also provides some control on who will attend your event. Do make sure to write the Rejection email text well 😉
Alternatively you could auto-reject or auto-confirm (and have the correct email send) based on the amount of leads on the static list people are added to on confirm. You would need to call a webhook to a custom script to determine the amount of leads on the registrants list. That script would need the REST API to connect to Marketo and then use the ListController to determine how many leads were on the list: http://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#!/Static...
Or check for program membership of course.
Well, if you don't disable or mention sold-out events even though there are other available slots, you're just inviting oversold events. You can flag non-oversold events instead of disabling them, but not mentioning it makes little sense.
Would never use REST API calls on response to public traffic. Recipe for catastrophe!