From looking at these examples and some tests of my own, the data seems to be consistent with the following simple theory:
A) If the AI plays Lurker, it will simply "do nothing".
This is rules-conform if there are no action cards in the trash, because the choice to use the "gain an Action card from the Trash" branch is valid, and when there are no action cards in the trash, "do nothing" is the only possible course of action. But it becomes not rules-conform if there are Action cards in the trash, so I guess the game engine will not allow the AI try to "do nothing".
I've never seen the AI do anything (actually trash or gain anything) when it plays Lurker and it froze always when there were Action cards in the trash.
As an experiment, I made a Kingdom with Lurker, Masquerade and 8 non-Action cards. I fed the AI lots of Lurkers, and at the end of the game #4596998 there is one 1 Action card remaining in the supply (a Lurker) and one Action card in the Trash (a Masquerade). You can see in the log that the AI did play Lurker a few times with "no effect" (turn 8,9,12). This was all before I trashed the Masquerade in turn 14.
If you load the game at its end (playing as Ingix), it is your turn and you have a Lurker in hand. If you do nothing, the AI will play a Lurker next turn and the game will freeze (because either branch of Lurker has an Action card that could be selected). But if you use your Lurker to trash the last Lurker in the supply, then the AI's Lurker play next turn will succeed (despite the Masquerade in the Trash), because now the other branch of Lurker (to trash an Action card from the supply) is impossible to do.