cra3y, hi,
captchas are caused by different thing than useragent. I think you can have almost any useragent you want and Facebook won't complain. You correctly guessed that "DeviceID" in Miranda means persistent cookie from Facebook which identifies active session. And showing or not showing captchas is related to the particular DeviceID, yes. Because Facebook can start thinking that some computer (active session) is infected by some malware. That's why it then shows captchas or login error that you need to clean your computer first.
How Facebook guesses that on some session is malware? Probably by using old or invalid communication requests, deprecated API or something like that. Useragent doesn't matter here (maybe unless it's some known malware id). Few days ago I changed/fixed some things which could have caused this, so hopefully it will be okay from now on.
When you're already seeing captchas, you can delete DeviceID to "create" new session with next login, and/or just fill the captcha codes and Facebook will stop showing them to you in a few hours/days probably.