Is it possible on Enter event to detect that the cursor is in a table?

Yes, use the system fields
&V[_cursorrow]
&V[_cursorcol]
position of cursor: row and column
available in an InputScript if the user has placed the cursor in an input field
&V[_tabrow]
&V[_tabcol]
position of cursor: number of the table row and number of the table column, in each case beginning with 1
available in an InputScript if the user has placed the cursor in a table cell
So, in order to detect that the cursor is in a table, you can use
if not V[_tabrow=0]
...
endif