The idea was so tempting that I went ahead to test that into my program with C# and IB. The first thing my computer said to me was "transaction with net position negative one" when a limit sell order was transacted. It was a monotonous emotion-free female voice. The emotion-free part is kind of creepy. I am still working on adding more "emotion" and "urgency" when level 2 prices are hit. 
All the jokes aside, what you want is possible. I had fun just thinking about the idea. Though I advise you not implement automated trading just yet because it may not be ready. I think you have a mean reversion system. One implementation problem maybe when a market is having a really bad day, dozens and even hundreds of your 500 stocks may hit level 2 within minutes. Does the messages queue up like in answering machine or does level 2 messages gets read first? If you have automated trading, you may incur long position in literally hundreds of stocks in a short time. I am guessing you are not ready for that. So it is best to have some manual practice and risk control in place before you think about automating it.

All the jokes aside, what you want is possible. I had fun just thinking about the idea. Though I advise you not implement automated trading just yet because it may not be ready. I think you have a mean reversion system. One implementation problem maybe when a market is having a really bad day, dozens and even hundreds of your 500 stocks may hit level 2 within minutes. Does the messages queue up like in answering machine or does level 2 messages gets read first? If you have automated trading, you may incur long position in literally hundreds of stocks in a short time. I am guessing you are not ready for that. So it is best to have some manual practice and risk control in place before you think about automating it.