This is the forum for helping you out if you're stuck or if you want to discuss the nitty gritty details of the dungeons within Mount Grimrock. Warning: forum contains spoilers!
near an alcove but on the floor should behave as though no alcove were there, it's not "in the alcove on the floor" but rather it's simply not in an alcove, but is simply on the floor. The early search code should work for that. Except it may not work if you have any map notes on those squares.
That’s it! After removing all notes from my map, the item was found!
So now I have two working scripts: One for searching the tiles and one for searching the alcoves.