I don't think there is any proven formula for getting an upgrade, especially at no cost. Those are given on a somewhat random basis, usually from categories which are overbooked into those that are not. There's a lot of luck involved.
At the port, you can purchase an upgrade, if the category to which you want to move has openings. This will cost pretty much the same as if you had booked it in advance. It's worth asking when you check in what it would cost to upgrade to a category 5 or 6. You may feel like it's worth it at the time, having written the big check 60 days prior.
As for ideas, I guess I don't really have any. If you have a lucky shirt, hat, pair of underwear, etc., it couldn't hurt to wear it. It's not out of the question that it will happen on its own, but it is fairly rare. Say they have five cabins that they need to upgrade due to overbooking. There are still another 872 cabins on the ship, so you can figure the odds.
Good luck!