So, I recommend you to read a page called gameprogrammingpatterns.com. The topics will explain you how to solve common problems on game development and create code that is not confusing or hard to maintain. The page mostly use c++ to show examples but it's not hard to use those ideas on smilebasic.