I'm guessing from what you said your C script worked by detecting the spaces on board then assigning them in an 2dArray (probably boolean with it referring to blank/taken) and then checking the best option based on incoming shape (once again changing it to 2dArray).
Using that method, it would be most effective, I think, to use a similar method. Prioritise searching with the most common holes first going down in order and only searching with small penetration at the beginning then getting deeper (referring to rows down from the top). It may also be more effective to only re-assess the board when a line is supposedly cleared by checking for full rows in Scar.
Of course, those suggestions are only effective if I got the right gist of your script - would be much easier with some actual code or a small walkthrough on the idea behind it
By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.