How to run ALTER TABLE on a list of tables sequentially in a function
The problem is that you cannot use parameters as object names (tables, columns, etc.) in straight SQL statements, like your ALTER TABLE above.  

I use 'straight' here as an opposite of 'dynamic' - the thing you need:

...
loop
    EXECUTE format($$ALTER TABLE %I SET SCHEMA TO data_archived$$, 
                   table_rec.table_name);
END loop;
...


Notes: 


here I am using dollar quoting when building the dynamic query.  This allows me to use 'normal' syntax, as opposed to multiplicating single quotes, for example (not present in this example).  This way most editors will highlight the statements nicely.
I also use format() with the %I format specifier to have the object name properly quoted if necessary.  This approach is far more readable than building the query with concatenation of string constants and some quote_ident() calls.  It is present in versions 9.1 and newer.
I have a feeling that you compare stuff like quote_ident('This_table') IN ('This_table'), which won't be true.  Either use quote_ident() on both sides - or it is easier to just omit quoting and compare the string values.