Assuming that Act_flag determines environment, then it's simple: just complete the WHERE clause:
... WHERE (Act_flag = 1 AND Date < Getdate - 100)
OR (Act_flag = 0 AND Date < Getdate - 500)
But the problem is that you can't specify a variable as the table name: SQL will not let you.
To do that, you'd have to create a string using the variable:
SET @cmd = 'INSERT INTO ' + @TableA + ' (ID) ... ';
But that's dangerous! Depending on where you got @TableA from, you could be wide open to Sql Injection, which can compromise, damage, or destroy your database.
And I'm a little concerned that you use production / development in SQL code - I hope like heck you aren't developing on the same database as the production system uses, because if you do ... Well, you'll find out and your boss(es) will drop on you like a ton of bricks when you make a tiny mistake with the production data ... you do need to use a totally separate system from dev testing, partly for data protection / GDPR reasons, mostly for "oops, I deleted the orders table" reasons.