Yes, it is totally possible.
You're going to need a CRON job that runs daily to make sure you downgrade your users every day.
You will also have to define what "inactivity" means. Assuming you mean that the last write operation was performed in more than a month, then you can use the value set in the ^users table. Otherwise, you will have to create your own "inactivity" tracking.
You don't even need to write a plugin for this as you could write a script to check every user. Make sure to follow the guidelines here: http://docs.question2answer.org/code/external/
The script itself can be deducted by looking at the pages/user-profile.php file. Specifically near the qa_set_user_level() function call. Beware the categories.