Distinguish between schema and database
You have to declare your variable as the desired type.  The %TYPE construct is for copying types, therefore it is usable in the DECLARE section only.  In return, the assignment will be simpler:

DECLARE
    v_tmp_host scan.location.alias%TYPE;
    v_ip_address character varying;
BEGIN
    v_ip_address := '127.0.0.1';
    v_tmp_host := v_ip_address;
    [...]


The only change to your code is that I completely omitted the cast from the assignment.  In this case, PostgreSQL won't try to resolve scan as a database name, since cross-database references are not implemented...

If you declared your variable with a certain type, assignments will try to cast the given value to that type.  In case of failure you'll get an error.  Since normal inet input is just a single-quoted string, a varchar will be accepted (if its format fits the inet input format).