Loop rule (in OH2)

Come to think about, you cannot use an item object in such a comparator
Please note that almost everything in openHAB is object based programming, which means that items are complex objects and not just a number or string.
you have to use:

if (Avtivity.state == 5)

this should allow you to access the state of your object Activity and compare it against a number (your rules reads that the state is a simple number)

However, I am still not sure your rule would fully work as intended. As your rule sleeps for two times 2.5 sec, you may want to watch out whether there is a possibility that the state of Activity can change to another value and back to 5 again within these 5 secs, which would trigger your rule again, while it is already running and cause confusion. (just one use case that comes to mind where your rule would fail); you can have reentry locks (there are forum posts on this topic, that would guard against triggering a rule twice, still your rule locks up too much resources, I believe)
You may want to look up the Tutorials section, especially the ones with timers. It may make more sense to launch a timer (which runs in the background) that blinks your lamp using recursive timers: