2. You need to decide how you want to store these lists of categories/animations - you can read them from a text file (csv, xml etc) or load as JSON into an array or dictionary.
Or you can simply create 6 text variables:
category1 = "anima1,anima3,anima5"
category2 = "anima2,anima4"
...
3. When player selects a category, you can choose a random animation from a comma-separated string of animations using this expression:
animationsList = category3 // for example
animationName = tokenat(animationsList, floor(random(tokencount(animationsList, ","))), ",")
Then set this animation to a sprite and choose a random frame:
Sprite1 set animation to animationName
Sprite1 set frame to floor(random(Sprite1.AnimationFrameCount))
Repeat the same steps for the seconds sprite.
4. How do you assign a value to selected frame I don't know, you need to give more information about these values. What are they? Are they different for each frame? Where are you planning to get these values from?